2 ms·
Receiving and handling I/O errors is easy, the harder part is when something goes wrong on the peer and you don't receive an error. When dealing with network c
by noselasd 14y ago
Receiving and handling I/O errors is easy, the harder part is when something goes wrong on the peer and you don't receive an error.
When dealing with network code, you need 1) Timeouts, 2) Keepalives.
What kind of keepalives and timeouts depend entierly on your needs. The problem is that most libraries/protocols doesn't have either, and most example code never shows this. (Any TCP example that does a read() or write() without any form of timeout is a DOS waiting to happen)