4 ms·
Indeed. These days, you have to expect users will wander out of their wi-fi range or have crappy mobile connections. Whenever I ride the train with my 4G tether
by jkarneges 12y ago
Indeed. These days, you have to expect users will wander out of their wi-fi range or have crappy mobile connections. Whenever I ride the train with my 4G tether, my TCP sockets die every few miles.
I lose ssh and my websockets, but long-polling apps keep working. Kind of ridiculous, but that's the world we live in.
Making your websockets resilient means pinging and aggressive reconnecting.
- saosebastiao 12y agoIt would be nice if you could drop the http overhead for long-polling though, which is the main reason I use websockets.
- nawitus 12y agoHave you tried socket.io-based web applications on the train? It does pings and reconnecting.
- different-opini 12y agoDo you know of any public socket.io apps?
- nawitus 12y agoEtherpad uses socket.io. Here's one hosted Etherpad: https://etherpad.wikimedia.org/ https://etherpad.wikimedia.org/
- jexe 12y agoDasher (http://dasher.im http://dasher.im), uses socket.io. We're using socker.IO-objc for our iOS client: https://github.com/pkyeck/socket.IO-objc https://github.com/pkyeck/socket.IO-objc And will be launching a web client in the coming weeks. So far, so good. We do handle the reconnects ourselves, but otherwise it's been treating us well.
- Svenstaro 12y agoHave you tried http://mosh.mit.edu/ http://mosh.mit.edu/?
- jkarneges 12y agoThat looks awesome. Will definitely check it out. Broken ssh connections make me sad.
- tribaal 12y agoMosh is great, I use it on an almost daily basis. Setting an alias like "alias sssh='mosh'" greatly helps with muscle memory, too (of course, don't override "ssh", you might still need it). Funny anecdote: I live in a city called "Moshi"
- icebraining 12y agoI don't recommend replacing ssh, but when you do want to shadow a command, you can always call the original using \, e.g.: \ssh
- mdpye 12y agoIf the connections are dropped quietly (client side does not find out the connection is gone) then how does the long poll case know that the existing poll conn is not going to return any data and a new one needs to be initiated? Or is it just that long polls generally have short timeout compared with what you might implement for a websocket ping?
- jkarneges 12y agoCorrect, long polling clients generally have timeouts. I wouldn't say they are necessarily shorter or longer than typical websocket ping intervals (I've seen as low as 20 seconds and as long as 2 minutes), but they do need to be there for the client to recover quickly.