Add socket abstraction

This commit is contained in:
Maurice Heumann
2025-03-20 15:17:43 +01:00
parent 2cb14a3555
commit 4da6642123
15 changed files with 437 additions and 71 deletions

View File

@@ -8,6 +8,7 @@
#ifdef _WIN32
using send_size = int;
using sent_size = int;
#define GET_SOCKET_ERROR() (WSAGetLastError())
#define poll WSAPoll
#define SERR(x) (WSA##x)
@@ -15,6 +16,7 @@ using send_size = int;
#else
using SOCKET = int;
using send_size = size_t;
using sent_size = ssize_t;
#define INVALID_SOCKET (SOCKET)(~0)
#define SOCKET_ERROR (-1)
#define GET_SOCKET_ERROR() (errno)