I have a UDP socket listening on a broadcast port and it works fine.
However, when I winter and resume the OS (Windows 7), the socket simply stops receiving data (and I see that there is data coming in using Wireshark).
This also happens if I change any network settings, for example, change my IP address by disconnecting and activating the network adapter.
The OS seems to disable all network adapters during sleep mode and reactivate them when resuming.
select
just returns 0
(timeout), which is no different than when I get no data. I could not find any references to this behavior anywhere.
If I close the socket and recreate it, it will start working again.
My cellular TCP listeners are still working fine after resuming the OS.
Any ideas on how to detect and fix this situation?
EDIT : it still receives direct address data only in order, it no longer receives brodcast transmissions.
EDIT2: Just found that if I write to a socket (send a dummy packet anywhere), it will start working again ...
source share