mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-17 14:21:30 +00:00
Fix error propagation from WinSock functions. Fix cleanup of sockets. Allow the handshake to be interrupted.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#define SetLastSocketError(x) WSASetLastError(x)
|
||||
#define LastSocketError() WSAGetLastError()
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
@@ -13,6 +14,7 @@
|
||||
#include <errno.h>
|
||||
#define SOCKET int
|
||||
#define LastSocketError() errno
|
||||
#define SetLastSocketError(x) errno = x
|
||||
#define INVALID_SOCKET -1
|
||||
#define SOCKET_ERROR -1
|
||||
#define closesocket(x) close(x)
|
||||
|
||||
Reference in New Issue
Block a user