can't remember

This commit is contained in:
Jeena Paradies 2011-02-11 12:28:34 +01:00
parent c67bcc32e7
commit fa63ea104b
9 changed files with 53 additions and 6 deletions

17
client Normal file
View 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