From: "Jesús Gabriel y Galán" Date: 2010-05-07T05:37:56+09:00 Subject: Re: gserver problem On Thu, May 6, 2010 at 10:26 PM, bussiere bussiere wrote: > 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") The problem is that in the server you are doing a io.gets, so it's waiting for a \n, which write doesn't produce. Try this: clientsock.puts("toto") > puts(clientsock.gets) > clientsock.close Jesus.