Python socket not sending host name
I am using an asyncore.dispatcher client on python to connect to a server
developed in C running on a PC. Here's the code snippet on the client that
connects to the server:
class DETClient(asyncore.dispatcher):
def __init__(self, host, port):
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect((self.host,self.port))
On the server side, my C code is looking for two parameters, TCPPeerName
and TCPPeerAddr.
It seems that the python code is not passing the hostname at all, because
my server gets a NULL for PeerName.
Do I have to do anything to specifically make the asyncore client to send
the PeerName when establishing a connection?
No comments:
Post a Comment