The fastest way is to use the OS network functions: socket() , setsockopt() , connect() , listen() , send() , recv() , etc. etc.
There are slight differences between them on several OSs.
To handle this, there are wrappers around them in several libraries, for example. in Qt (at least IIRC). I donβt think that something will slow down noticeably if you use them ...
source share