Normally we shouldn't use low level syscalls if there's an existing library that does the job better and makes it easier to maintain the code
How about we ditch the sockets, and move towards a proper C++ library? Our favorite is boost/folly, you don't have to do any async handling of IO, you can stay with blocking for simplicity, as you continue, try to make more use of C++ data structures rather than pointers to primitive types, and don't forget exception handling too.
Normally we shouldn't use low level syscalls if there's an existing library that does the job better and makes it easier to maintain the code
How about we ditch the sockets, and move towards a proper C++ library? Our favorite is boost/folly, you don't have to do any async handling of IO, you can stay with blocking for simplicity, as you continue, try to make more use of C++ data structures rather than pointers to primitive types, and don't forget exception handling too.