Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

Couldnt find client with session id "XXXXX" #107

Closed dasantonym closed 13 years ago

dasantonym commented 13 years ago

can anyone maybe explain this kind of error to me? is this caused by a dropped connection, but if so, why doesn't the client get disconnected right away.

i have an app running right now that produces these log entries. is this related to the firefox issue i saw here?

thanks!

tommedema commented 13 years ago

I'm sure I've got these as well, can't recall what caused them though..

dasantonym commented 13 years ago

some people complained about firefox so this was just a wild guess. still not really clear what exactly is going wrong there.

one question though, how should i handle dropped connections the best way? i need some form of auto-recovery for the clients.

steveWang commented 13 years ago

Firefox support for websockets is disabled by default, for some strange reason -- I have no idea if this is at all related to the firefox issue.

More relevantly, I think this is actually a Socket.IO error that you're seeing. Basically, it happens when a client attempts to connect with an invalid ID (e.g. reconnecting with an old one after disconnecting from the server). That being said, I haven't seen this error under normal circumstances. The strange part is that reconnecting in NowJS doesn't even touch Socket.IO's internals; on our end, we just do some things so that reconnecting won't hurt us (removing remote functions, preventing duplicate listeners from being added).

Without more information, I'm not entirely sure how this can be fixed in NowJS. Sorry.

steveWang commented 13 years ago

Regarding the dropped connections: I believe that you can use now.on('disconnect', callback) for the client. Perhaps set some timeout which gets cleared by now.on('reconnect', lambda). You can implement whatever reconnect logic there.

dasantonym commented 13 years ago

ok thank you, that helped me a lot!

now just one question, even if i am asking the obvious: who do i actually trigger a reconnect on the client? do i somehow re-initialise the now object and reassign the functions to it?

thanks!

dasantonym commented 13 years ago

i have taken this over to stackoverflow, cause i am not sure how this really qualifies as an issue for github. it's more of an issue of usage and understanding the basic mechanics. closing this now, thank you for all the help!

http://stackoverflow.com/questions/6409944/nowjs-manually-initiating-a-new-connection-after-a-lost-connection