Created
November 15, 2014 08:09
-
-
Save ymurase/5f33afd3aa32da3aa13c to your computer and use it in GitHub Desktop.
A sample of TCP client implemented by Ruby.
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' | |
sock = TCPSocket.open("127.0.0.1", 31400) | |
5.times do | |
sock.write("ping\n") | |
$stdout.puts "sent" | |
puts sock.gets | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment