Comment by lapcat
3 hours ago
> I am looking forward to learning how it does work...
It's basic sockets. If you call connect() when the internet is disabled, the errno is ENETUNREACH.
The higher-level API are built on sockets. If any apps are misbehaving, they're simply badly coded.
> It's basic sockets.
Yup. I've done a bit of that stuff, in my time.
> If any apps are misbehaving, they're simply badly coded.
Plenty of that stuff, going around.
Might want to ease back on the "instant insult" thing. Not a good look.
> Yup. I've done a bit of that stuff, in my time.
So are you willing to admit now that "the standard TCP timeout" was a misdiagnosis of your problem?
You appeared to be projecting a personal problem with some unnamed badly coded apps onto everyone, as if it were inevitable, but the original commenter who said they turned off WiFi obviously does not experience this problem, and neither do I for that matter.
Have a great day!
I don't think you can get ENETUNREACH from recv though. If the request was sent, it'll time out.
It can cause problems to flip off the internet when you already have open connections, though there are also API to detect changes in network availability. But I don't see that as a significant problem for "I turn off my WiFi now to do performance-sensitive work". First turn off WiFi, then launch the app you need, in that order. Problem solved.