Permalink
Browse files

Merge pull request #132 from dfens/master

Fix for issue #131
  • Loading branch information...
2 parents 51a9644 + 131394f commit ea9bfd5250127e6378c8a77db250b9c6b3c54672 @mperham mperham committed Oct 26, 2011
Showing with 16 additions and 8 deletions.
  1. +16 −8 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

0 comments on commit ea9bfd5

Please sign in to comment.