Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #132 from dfens/master

Fix for issue #131
  • Loading branch information...
commit ea9bfd5250127e6378c8a77db250b9c6b3c54672 2 parents 51a9644 + 131394f
Mike Perham mperham authored
Showing with 16 additions and 8 deletions.
  1. +16 −8 lib/dalli/socket.rb
24 lib/dalli/socket.rb
View
@@ -149,13 +149,21 @@ def readfull(count)
puts "Could not define alternate em-synchrony socket IO" if defined?($TESTING) && $TESTING
end
-class Dalli::Server::USocket < UNIXSocket
- def readfull(count)
- value = ''
- loop do
- value << read(count - value.bytesize)
- break if value.bytesize == count
- end
- value
+if RUBY_PLATFORM =~ /mingw|mswin/
+ class Dalli::Server::USocket
+ def initialize(*args)
+ raise Dalli::DalliError, "Unix sockets are not supported on Windows platform."
+ end
+ end
+else
+ class Dalli::Server::USocket < UNIXSocket
+ def readfull(count)
+ value = ''
+ loop do
+ value << read(count - value.bytesize)
+ break if value.bytesize == count
+ end
+ value
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.