can't remember
This commit is contained in:
parent
c67bcc32e7
commit
fa63ea104b
9 changed files with 53 additions and 6 deletions
17
client
Normal file
17
client
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env ruby -wKU
|
||||
|
||||
require 'socket' # Sockets are in standard library
|
||||
|
||||
hostname = 'localhost'
|
||||
port = 7000
|
||||
|
||||
s = TCPSocket.open(hostname, port)
|
||||
|
||||
|
||||
|
||||
s.print(q.chop)
|
||||
|
||||
while line = s.gets # Read lines from the socket
|
||||
puts "Got Echo: " + line.chop # And print with platform line terminator
|
||||
end
|
||||
s.close # Close the socket when done
|
Reference in a new issue