Skip to main content
added 5 characters in body; edited title
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

C++ server Server socket "wrap" functions

This is a small socket library I made to avoid complicated CC boilerplate code and several #includes for connecting sockets, bind, listening etc.

Please note that socket_create() does not support bind to specific IP address.addresses and that the IP parameter is ignored.

The only C++11C++11 feature I am using is constexpr.

  Even though it is C++11C++11, I decided not to wrap everything in a class, but to work with standard int.

In the future, I might add unix domain socketUnix domain socket in a way similar to socket_create() and / or SSL support, but at the moment I do not need those.

#sockets.hsockets.h

#sockets.ccsockets.cc

C++ server socket "wrap" functions

This is small socket library I made to avoid complicated C boilerplate code and several #includes for connecting sockets, bind, listening etc.

Please note socket_create() does not support bind to specific IP address. IP parameter is ignored.

The only C++11 feature I am using is constexpr.

  Even it is C++11, I decided not to wrap everything in a class, but to work with standard int.

In future I might add unix domain socket in a way similar to socket_create() and / or SSL support, but at the moment I do not need those.

#sockets.h

#sockets.cc

Server socket "wrap" functions

This is a small socket library I made to avoid complicated C boilerplate code and several #includes for connecting sockets, bind, listening etc.

Please note that socket_create() does not support bind to specific IP addresses and that the IP parameter is ignored.

The only C++11 feature I am using is constexpr. Even though it is C++11, I decided not to wrap everything in a class, but to work with standard int.

In the future, I might add Unix domain socket in a way similar to socket_create() and / or SSL support, but at the moment I do not need those.

sockets.h

sockets.cc

Rollback to Revision 1
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237
added 185 characters in body
Source Link
Nick
  • 1.6k
  • 10
  • 21
Source Link
Nick
  • 1.6k
  • 10
  • 21
Loading