49 #define OJPH_INVALID_SOCKET (INVALID_SOCKET)
50 #define OJPH_EWOULDBLOCK (WSAEWOULDBLOCK)
52 #include <sys/types.h>
53 #include <sys/socket.h>
54 #include <netinet/in.h>
55 #include <arpa/inet.h>
62 #define OJPH_INVALID_SOCKET (-1)
63 #define OJPH_EWOULDBLOCK (EWOULDBLOCK)
A small wrapper for some Winsock2 functionality.
std::string get_error_message(int errnum)
Abstructs obtaining a textual message for an errnum.
socket_manager()
default constructor
static ui32 get_addr(const sockaddr_in &addr)
Abstractly obtains the 32-bit IPv4 address integer.
static int ojph_socket_manager_counter
~socket_manager()
default constructor
socket create_socket(int domain, int type, int protocol)
Abstructs socket creation.
std::string get_last_error_message()
Abstructs obtaining a textual message for GetLastError/errno.
int get_last_error()
Abstructs get last error or errno.
A small wrapper for socket that only abstract Winsock2.
ojph_socket intern()
provides access to the internal socket handle
socket()
default constructor
void close()
Abstracts socket closing function.
bool set_blocking_mode(bool block)
Sets the blocking mode.
ojph_socket s
int for Linux/MacOS and SOCKET for Windows
#define OJPH_INVALID_SOCKET