From: Sean Warburton Date: 2010-01-24T00:09:03+09:00 Subject: Problems with Telnet Firstly I'm a total newbie not just to Ruby but programming full stop so go gentle, please :) I'm looking for some help with a telnet problem. I am using a service that uses telnet to let you check the registration status of a domain name, you can only make so many requests per day so the maximum rate you can send requests at is every 200ms. You also have to keep the connection open as it takes 3 seconds to open a connection, each name has to be followed by a carriage return and new line and finally the final request needs to finish with #exit. The problem I have is this ... I can open a connection no problem and if I send the following command cmd("domain1.ca\r\ndomain2.ca\r\n#exit") {|str| print str} I get the information I need returned for both domains but because I need to wait 200ms between each domain, I need to actually send ... cmd("domain1.ca\r\n"){|str| print str} sleep 0.2 cmd("domain2.ca\r\n#exit"){|str| print str} When I do that I get the correct information for the first domain then it sits for a couple of seconds before returning a timed out error. Can anyone point to what I'm doing wrong and also give me some pointers on the best way to read and chomp the replies from the service. TIA Sean -- Posted via http://www.ruby-forum.com/.