From: kingsley@... Date: 2003-07-04T23:50:39+09:00 Subject: Re: Stuck with Telnet still Hi Hmm that doesnt work, I have to keep my finger on the return key to see the server repsonse and it all comes out in a 1 character wide space - each time I hit return it shows me another character. I\'m on a windows platform - did this code work for you ? The only change I see was that you regex for quit - and break on that. Which doesn\'t help much unfortunately Appreciated anyway Kingsley On 07-04-2003 03:36 pm, you wrote: > >>>>> \"K\" == Kingsley Hendrickse writes: > > > K> I am still stuck with this telnet client :( > > Try something like this > > svg% cat b.rb > #!/usr/bin/ruby > require \'socket\' > require \'thread\' > > sock = TCPSocket.new(\'ancient.anguish.org\',2222) > $stdout.sync = true > > t1 = Thread.new do > while line = gets > sock.puts line > break if /^quit/ =~ line > end > end > > t2 = Thread.new do > loop do > ch = sock.recv(1) > putc ch > end > end > > t1.join > > svg% > > > Guy Decoux > > >