Trying to set up some basic socket code in Python (well, Jython, but I don't think that's relevant here).
import socket
class Foo(object):
def __init__(self):
#some other init code here
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect("localhost", 2057)
s.send("Testing 1,2,3...")
data = s.recv()
s.close()
print data
It tells me:
s.connect("localhost", 2057) File "<string>", line 1, in connect TypeError: connect() takes exactly 2 arguments (3 given)
I get the feeling something really simple is staring me in the face, but I can't tell what I'm doing wrong.