netbeast / react-native-ssdp

SSDP client + server to use in your react-native apps
https://netbeast.co
41 stars 19 forks source link

null is not an object (evaluating 'self.sock.address') #27

Open jasonbodily opened 4 years ago

jasonbodily commented 4 years ago

SSDP.prototype._start adds listeners, but SSDP.prototype._stop doesn't remove them. The result is sock can be null when 'listening' is called. Should the client.stop() method remove listeners?

jedashford commented 3 years ago

@jasonbodily Did you end up making a code change to fix this?

jasonbodily commented 3 years ago

I did in our local code (a kind of hack), by calling removeAllListeners() on the socket before stopping it.