Force disconnect causes "In Use" flag to never be unset
Closed this issue · 2 comments
stephen commented
e.g. Turning off wifi on iPad will cause nodetunes to refuse connections from other devices, thinking that the iPad is still connected.
stephen commented
In practice, I've seen OPTIONS
being broadcast to the server ~1 request/second, but unsure if this is a standard heartbeat mechanism. If so, we could do something like:
socket.setTimeout(2000, this.disconnectHandler.bind({ self: this, socket: socket }));
But if this isn't the case, we'll be needlessly killing sessions.
stephen commented
Officially, we should use the data from the control port (https://github.com/stephen/nodetunes/blob/master/lib/rtp.js#L40) to determine a timeout.