hi, i am a beginner in ruby and
i’ve made to tiny scripts but it doesn’t seem to work if you have any
idea
thanks :
server :
require ‘gserver’
class BasicServer < GServer
def serve(io)
loop do
line = “”
line = io.gets
puts line
io.puts("Hello world! "+line )
end
end
end
server = BasicServer.new(1234)
server.start
server.join
Client :
require “socket”
print(“Connexion…”)
clientsock = TCPsocket.open(“localhost”, 1234)
print(" terminée\n")
clientsock.write(“toto”)
puts(clientsock.gets)
clientsock.close
regards
Bussiere