Commit d3b0f38d authored by Guido van Rossum's avatar Guido van Rossum

Support default port.

parent bfef4a08
......@@ -39,7 +39,9 @@ TAB = '\t'
# Open a TCP connection to a given host and port
def open_socket(host, port):
if type(port) == type(''):
if not port:
port = DEF_PORT
elif type(port) == type(''):
port = string.atoi(port)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment