socket programming

John Hazen john at hazen.net
Wed Jul 20 01:33:22 CEST 2005


* Helge Aksdal <helge at aksdal.net> [2005-07-19 11:23]:
> if i then change to a console window, and telnet to this server it
> sends me to another one. That's probably why my program dies, how
> can i get my code to handle this?
> 
> Trying xxx.xxx.xxx.xxx
> telnet: connect to address xxx.xxx.xxx.xxx: Connection refused
> Trying xxx.xxx.xxx.xxx
> Connected to xxxxxx.xxxxx.
> Escape character is '^]'.

I don't think the server is "sending you to another one".  I think
perhaps DNS returns two IP addresses for the name, and after the first
one fails, your telnet client tries the second?

I'm just guessing, since you didn't include what command you ran to do
the telnet.  As Grant mentioned, the telnet protocol doesn't do
redirects.

-John



More information about the Python-list mailing list