unexplained disconnect 'transport end' after upgrading
After adding a dependency to my package.json today I removed my node_modules and ran npm_install. I didn't specify any version number for socket.io so I guess it picked up the latest.
After I did that I noticed that within ? a minute or so of starting up my application, my socket would be disconnected and I see a 'transport end' info message in the node.js console output. I having socket.io set for websockets only. I am on Chrome 13 on Linux.
I went into package.json and set it at 0.8.7, ran npm install again, and now I am not seeing disconnects anymore.
Hopefully I wasn't just confused about something. I did go back and repeat the steps and had the same result. Sorry I don't have more specific information.
0.9.1 could have introduced a bug with heartbeats triggering premature disconnects. I'm looking into it and might have a 0.9.2 tomorrow
Ditto. Seeing repeated disconnects/reconnects in Chrome & FF on Mac, client & server on same machine. Easily seen from socket.io examples in the readme, default settings untouched.
Having the same issue...I also noticed that immediately after the socket disconnected a new socket was instantiated.
Workaround for me was manually setting the close timeout:
io.configure( function() {
io.set('close timeout', 60*60*24); // 24h time out
});
I was having this problem too. Thanks steffenwt for the workaround.
Yep, I have this error too. I started learning socket.io a few days ago and I first thought I was doing something wrong.
Downgrading to 0.9.0 works.
Not sure if relevant, but the socket gets closed on every other heartbeat. So it goes like this
connect
heartbeat2 gets sent and recieved all fine
heartbeat3 gets sens but never gets recieved
disconnect
Log here:
debug - emitting heartbeat for client 18615332192056708826
debug - websocket writing 2::
debug - set heartbeat timeout for client 18615332192056708826
info - transport end
debug - set close timeout for client 18615332192056708826
debug - cleared close timeout for client 18615332192056708826
debug - cleared heartbeat timeout for client 18615332192056708826
debug - discarding transport
I has the problem too.
I use 0.91-1 .
I try it ,but has this problem.
io.configure( function() { io.set('close timeout', 60_60_24); // 24h time out });
same problem here
Did you downgrade to 0.9.0 ? I now marked it as latest on NPM
same issue here for 0.9.1-1, juste downgraded to 0.9.0, and the problem is gone.
as a workaround you can send some keep-alives from client, for say 20 secs and immediately answer those from server:
client: setInterval(function() { socket.emit("keep-alive", null) },20*1000); server: socket.on('keep-alive', function (data) { socket.emit('keep-alive', null); });
FWIW: If you are serving the client from a different server, and your client code is not downgraded to 0.9.0 then you'll still see the problem.
I downgraded 'socket.io' to 0.9.0 and I still saw the problem. Then I downgraded socket.io-client to 0.9.0 and I don't get the disconnect.
Also, the transports I've tried that fail are web sockets and xhr-polling.
This issue should get closed, right?
I have the same problem. But I noticed that it is because I have haproxy.
My problem is here:
frontend all 0.0.0.0:80
default_backend www_backend
acl is_websocket path_beg /socket.io
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i ws
timeout client 1000
Right in the line "timeout client 1000" (I changed it to 1 second to see if it was the problem, and it was...).
So now I'm searching if there is a way to change it only for the websocket backends.
I hope this help someone :+1:
FYI, I'm still seeing this issue, too, with xhr-polling and 0.9.14. There's a forced disconnect every 25 seconds. Log is identical to above.
I can also verify that this is happening with 0.9.14 server and 0.9 client. Although it doesn't disconnect every 25 seconds, it does disconnect intermittently. I traced it to a call stream.emit('end'); in node.js' _stream_readable.js. I think it is a result of reading EOF in the buffer.
@citosid why would haproxy client timeout cause this?
Happening with 0.9.16. Same thing as for BoarK
Is socket.io support dead?
@joefaron There has to be support before it can die. So no, Socket.IO support isn't dead, it just never existed.