Having 2 python programs , host1.py and host2.py which run simultaneously and communicate via socket such that –
host1.py has reciveSock = socket(AF_INET,SOCK_DGRAM)
and host2.py has sendSocket = socket(AF_INET,SOCK_DGRAM) .
Both the socket’s are binding each other .
At host1.py has –
try:
msgBacked = reciveSock.recv(256)
except:
pass
if( msgBacked is None):
print "isNone!"
And indeed it prints isNone! mean msgBacked is a None .
All the send’s from host2.py to host1.py are in a type sendSocket.send("ACK") so that there is a value in the sent string which tranported to host1.py .
So how this msgBacked could be None ?
Most likely
receiveSock.recvis throwing a timeout exception, andmsgBackedwas previously set toNone. Try removing thetry .. exceptand see what happens.