From: kjana@...4lab.to (YANAGAWA Kazuhisa) Date: 2002-02-22T21:21:31+09:00 Subject: Re: Any ideas on why this doesn't work? You should: 1. write the issue in the message body 2. what you needed/wanted/expected and actually what occured In message moonerent@hotmail.com writes: > require 'socket' > server = TCPServer.new('127.0.0.1',5190) > while (session = server.accept) > begin > thisUser = session.gets > thisUser = thisUser.scan(/(.*?)<\/user>/).to_s > > session.print "#{thisUser}\0" > > ensure > session.close if session > #puts "sesson closed" > end > end I ran it and got results I expected. That is: # on some term: >ruby <(.*?)<\/user>/).to_s session.print "#{thisUser}\0" ensure session.close if session #puts "sesson closed" end end EOS # and on the other: >telnet localhost 5190 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. foo fooConnection closed by foreign host. I doubt your undisclosed client code doesn't send "\n" and so the server is waiting for "\n" on IO#gets, but it's just a my guess. -- kjana@dm4lab.to February 22, 2002 Time is illusion, life is confusion.