Add socket wrapper

This paves the way to store an additional "closed" flag on Windows
to interrupt and close properly.
This commit is contained in:
Romain Vimont
2021-10-26 22:49:45 +02:00
parent 3eac212af1
commit e5ea13770b
2 changed files with 67 additions and 15 deletions

View File

@@ -13,8 +13,10 @@
# define SHUT_RD SD_RECEIVE
# define SHUT_WR SD_SEND
# define SHUT_RDWR SD_BOTH
# define SC_INVALID_SOCKET INVALID_SOCKET
typedef SOCKET sc_socket;
# define SC_INVALID_SOCKET NULL
typedef struct sc_socket_windows {
SOCKET socket;
} *sc_socket;
#else // not __WINDOWS__