jinroh / kadoh

The Kademlia DHT in Javascript for Node.js and Browsers
http://jinroh.github.com/kadoh
Other
242 stars 31 forks source link

removal of listeners before closing results in disconnect state not being set #67

Closed garyhodgson closed 10 years ago

garyhodgson commented 10 years ago

Hi,

I noticed that the disconnect state was not being propagated after closing the udp connection. I believe it is because the listeners are removed before the socket is closed. This pull request has my fix, but you might want to double check whether my moving the "removeAllListeners" is the right thing to do.

Cheers, Gary

alexstrat commented 10 years ago

Thx