[Tutor] Sockets -- huh?

JRicker joejava@dragoncat.net
Thu, 22 Mar 2001 22:54:17 -0500


Decided to learn about sockets and python.  The object of my desire so
to speak would be a helper program for a game called Tradewars.  Used to
be played on alot of BBSs back when they were more prevalent and now
several servers are running it.  I'm trying to telnet in if that makes a
difference.  I started small and simple:

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
    s.connect(("216.211.84.44", 23))
except Exception, e: print e

s.send("\n\n") # this line was added after the rest, hoping to get a
response.

test = s.recv(1024)
s.close()
print test

but test isn't printing anything out.  I'm expecting to get at least:

Telnet connection detected.

Please enter your name (ENTER for none):

I know that at least a connection is being made because while my script
was running, I tried logging in with telnet.  The server only allows one
connection from any one IP address and it denied me entrance until the
script finished running.

Any thoughts?

Thanks
Joel

-----------------------------------
Nomopoly III now open.  Join Today!
http://www.justthefaqs.org/nomopoly/