From: Steven Jenkins Date: 2004-04-25T00:09:03+09:00 Subject: Re: Playing with sockets... Hal Fulton wrote: > I'm writing a little expect-like piece of code and trying to test it > by connecting to a telnet port. > > Not working at all for me. I made the obvious changes to make it connect to the SMTP daemon on my machine and it works fine on Linux with Ruby 1.8.1 (2004-02-06). Nothing is ever discarded from @data, and you search from the beginning each time, so you'll never find the second occurence of any string, but that's not the problem you're having here. Are you sure your telnet daemon is behaving? That trash string found at the beginning is not right. Steve