I am experiencing some strangeness while playing around with Tubesock. I have some very basic code, very similar to the example app.
It seems to me that when I reload the browser so that the open socket is closed and a new one is opened, the app then continues to call the on close callback over and over forever. It seems as if it calls it every times it pings a closed socket, but I am not totally sure exactly what causes this.
Just to test, I just put the following code in an initializer, and it does stop the callback from being called, but I am still not sure if it actually properly stops and releases the closed socket.
class Tubesock
def keepalive
Thread.new do
Thread.current.abort_on_exception = true
loop do
sleep 5
Thread.current.exit if @socket.closed?
ping
end
end
end
end
I am experiencing some strangeness while playing around with Tubesock. I have some very basic code, very similar to the example app.
It seems to me that when I reload the browser so that the open socket is closed and a new one is opened, the app then continues to call the on close callback over and over forever. It seems as if it calls it every times it pings a closed socket, but I am not totally sure exactly what causes this.
Just to test, I just put the following code in an initializer, and it does stop the callback from being called, but I am still not sure if it actually properly stops and releases the closed socket.