3 ms·
> On the one hand, you're right -- in that I can see and respect why you say that. > On the otherhand, what the heck is wrong with using the syscalls? Every ti
by jcelerier 9y ago
> On the one hand, you're right -- in that I can see and respect why you say that.
> On the otherhand, what the heck is wrong with using the syscalls? Every time I write a new high performance networking application, sure, i lose a day or two building primitives out of send recvmsg listen accept and splice, but once i'm done, i'm done, and things work.
...
> Tangentially, I positively can't WAIT for Networking support in c++20 -- that and Concepts I've been waiting for with baited breath.
You know that the networking support in c++20 is just Boost.Asio with namespace std, right ? You could have been using the exact same API today (or ten years ago for what it's worth), which is header-only, and supports TCP, UDP, Unix sockets, SSL, serial port communication, and all of this either synchronously or asynchronously, etc...
> I'm confused why people feel the need to make paper thin abstraction layers covering the berkeley sockets API.
Because:
* there are more efficient ways than the sockets API. For instance on windows the preferred way is IOCP: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365198(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa3... which allows for far better behaviour when multi-threading than select / poll.
* that's like saying "std:string is a thin abstraction layer over const char* and strlen". There is much more to this in big networking libraries: event loop handling, thread pools, etc.
- pjmlp 9y agoAnd on macOS BSD sockets are on their way out, as the new networking stack (user space based) doesn't support BSD sockets (page 15). https://devstreaming-cdn.apple.com/videos/wwdc/2017/707h2gkb95cx1l/707/707_advances_in_networking_part_1.pdf https://devstreaming-cdn.apple.com/videos/wwdc/2017/707h2gkb...