5 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 time
by loxias 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.
I'm confused why people feel the need to make paper thin abstraction layers covering the berkeley sockets API. In the time it takes one to learn how to use the flavor of the month, one probably has gotten halfway there to understanding how to Really do networking.
It's not like networking on Linux is even a shred harder than easy...mumbles off into the distance unlike BLE on Windows10 (and linux)....
Tangentially, I positively can't WAIT for Networking support in c++20 -- that and Concepts I've been waiting for with baited breath.
[EDIT: apologies, i think my tone got away with me.. stupid aspie tendencies... what i MEANT to say somewhere in there, directed to the author, was: "Good Job!!" It's hard work to put yourself out there and enjoy accomplishment. Please do let the rest of the community know if you'd welcome help in porting it to other platforms and adding features and improving performance. Best!]
- moron4hire 9y agoBLE on Windows 10 is exactly the same as BLE on every other platform.
- jcelerier 9y agoWhat ? of course not. The BLE (and bluetooth, for what it's worth) API is different on every platform. On windows: https://msdn.microsoft.com/en-us/library/windows/hardware/hh450825(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/hardware/hh... On linux: https://github.com/carsonmcdonald/bluez-experiments/blob/master/experiments/scantest.c https://github.com/carsonmcdonald/bluez-experiments/blob/mas... On macOS: https://github.com/sandeepmistry/osx-ble-peripheral/blob/master/BLEPeripheral/BPAppDelegate.m https://github.com/sandeepmistry/osx-ble-peripheral/blob/mas...
- moron4hire 9y agoThe names of the functions are different, but they fundamentally do the same things
- juiyout 9y agoIsn't every platform "fundamentally" do the same things?
- 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...