Function close() from coap is not closing the socket.

Description

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):

  1. declare that this thread has to stop
    self.goOn = False

  1. 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

  1. wait for this thread to exit
    self.join()

Now it is working.

Environment

I am using a ubuntu version.

Gliffy Diagrams

Activity

Details

Assignee

Reporter

Priority

Created June 9, 2015 at 9:19 PM
Updated June 9, 2015 at 9:20 PM