Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (19 sloc) 460 Bytes
# Use in conjunction with ds_server.rb for testing puts/putc/gets/getc
# Expected output is:
# OH
# Nice to see you!
# Today would be improved by snails, don't you think?
# T
# three four five six seven eight nine ten (in some order or other)
require 'bundler/setup'
require 'socket'
require 'eventless'
host = 'localhost'
port = 2000
s = TCPSocket.new host, port
2.times { putc s.gets }
while line = s.gets
break if line == ""
puts line
end
s.close
Jump to Line
Something went wrong with that request. Please try again.