Skip to:
I was running an experiment and I found that the function close() from coap was not really closing the socket.
Thereby, I added the following command in the file openwsn/coap/coap/SocketUdpReal.py:def close(self):
declare that this thread has to stopself.goOn = False
send some dummy value into the socket to trigger a readself.socket_handler.sendto( 'stop', ('::1',self.udpPort) )
self.socket_handler.close() #line added
wait for this thread to exitself.join()
Now it is working.
I am using a ubuntu version.
I was running an experiment and I found that the function close() from coap was not really closing the socket.
Thereby, I added the following command in the file openwsn/coap/coap/SocketUdpReal.py:
def close(self):
declare that this thread has to stop
self.goOn = False
send some dummy value into the socket to trigger a read
self.socket_handler.sendto( 'stop', ('::1',self.udpPort) )
self.socket_handler.close() #line added
wait for this thread to exit
self.join()
Now it is working.