Created
April 16, 2014 14:15
-
-
Save unclebilly/10882630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
socket = TCPSocket.new('127.0.0.1', 80) | |
# In JRuby 1.7.10, reading 0 bytes blocks the caller. | |
# In MRI 1.9.3 and 2.1.1, reading 0 bytes immediately returns an empty string. | |
socket.read(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment