I'm currently coding a socket server in Python (VS2012 addon)
But I'm stuck and can't get a new socket from an accepted connection.
new = sock.accept()
acc_addr = new
ip = acc_addr
connid = acc_addr
print 'Received connection from ' + ip + ':' + connid.__str__()
new tuple returned by
accept() has 2 elements: at
, there is the address tuple, consisting of the
ip and the port (named
connid by you) - and at
0 there is a socket object which can be used for communicating with the client.
So just do
clsock = new and you have your