I have a python program that is supposed to connect to a server and receive specially formatted packets, that I can test and filter out. I can connect to the server, but I can’t see that I am receiving any packets – though I am sure that I am. I don’t know how to debug this.
class client:
def __init__(self, host ='127.0.0.1', port=12345):
self.host = host
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((self.host, self.port))
def get_next_event(self):
pkt_size_data = self.sock.recv(4)
# on the above line I am not getting any response, the client just waits for something....
pkt_size = self.size_struct.unpack((pkt_size_data))[0] #I never get here
pkt_data= self.sock.recv(pkt_size)
#( get_next_event is called from an infinite loop )
I am using VS2010 – setting breakpoints – looking at my objects using VS2010 tools – are there some tools I can use to debug and see why I am not getting any response from the recv?
Any idea why I am not getting any response ?
Try sniffer to see what’s going on. Try http://www.wireshark.org/