Comment by umanwizard

2 years ago

Well, isn't that already how it works? If I physically unplug my ethernet cable, won't TCP-related syscalls start failing immediately?

Last time I looked the behavior differed; some OSs will immediately reset TCP connections which were using an interface when it goes away, others will wait until a packet is attempted.

I ran into this with websockets. At least under certain browser/os pairs you won't ever receive a close event if you disconnect from wifi. I guess you need to manually monitor ping/pong messages and close it yourself after a timeout?

Probably, but I don't know how the physical layers work underneath. But regardless, it's trivial to just monitor something constantly to ensure the connection is still there, you just need the hardware and protocol support.

  • Modern Ethernet has what it calls "fast link pulses"; every 16ms there's some traffic to check. It's telephones that use voltage for hook detection.

    However, that only applies to the two ends of that cable, not between you and the datacentre on the other side of the world.

  • What if I don't want all my SSH connections to drop when my WiFi stutters for a second when I open my microwave?

  • > I don't know how it works... it's trivial

    Come on now...

    And it is easy to monitor, it is just an application concern not a L3-L4 one.