5 ms·
Using sockets is very portable imo. If I remember correctly there's only 2 functions that differ between linux and windows[1]. I'd rather use 2 source files tha
by SCHiM 10y ago
Using sockets is very portable imo. If I remember correctly there's only 2 functions that differ between linux and windows[1]. I'd rather use 2 source files than the whole boost asio/networking library.
[1] Those are ioctlsocket vs ioctl, and closesocket vs close.
A basic TCP implementation can be cross platform with as little as 2 #ifdef/#endif blocks.
- Matthias247 10y agoOnly if you are sticking to synchronous IO. With nonblocking and async IO it gets much more complicated.