aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/common/Sockets.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-06-23 10:25:18 +0200
committerShauren <shauren.trinity@gmail.com>2023-06-23 10:25:18 +0200
commit9ad1e5d635e2fd4c2486d5f2bf1cb52d8e768558 (patch)
tree00b379e3f84ff5b428f0fafd5bdeac0489ede0c4 /dep/CascLib/src/common/Sockets.h
parent54596eb8ce5d7933164073eb3768f52124ba4262 (diff)
Dep/CascLib: Update to ladislav-zezula/CascLib@ebd79e8fd43279343c543a27fce620f6b1b53cb9
Diffstat (limited to 'dep/CascLib/src/common/Sockets.h')
-rw-r--r--dep/CascLib/src/common/Sockets.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/dep/CascLib/src/common/Sockets.h b/dep/CascLib/src/common/Sockets.h
index c821748802b..917be387234 100644
--- a/dep/CascLib/src/common/Sockets.h
+++ b/dep/CascLib/src/common/Sockets.h
@@ -14,10 +14,6 @@
//-----------------------------------------------------------------------------
// Defines
-#ifndef INVALID_SOCKET
-#define INVALID_SOCKET (SOCKET)(-1)
-#endif
-
#ifndef SOCKET_ERROR
#define SOCKET_ERROR (-1)
#endif
@@ -57,9 +53,9 @@ class CASC_SOCKET
// Constructor and destructor
static int GetSockError();
static DWORD GetAddrInfoWrapper(const char * hostName, unsigned portNum, PADDRINFO hints, PADDRINFO * ppResult);
- static SOCKET CreateAndConnect(addrinfo * remoteItem);
- static SOCKET ReconnectAfterShutdown(SOCKET & sock, addrinfo * remoteItem);
- static PCASC_SOCKET New(addrinfo * remoteList, addrinfo * remoteItem, const char * hostName, unsigned portNum, SOCKET sock);
+ static HANDLE CreateAndConnect(PADDRINFO remoteItem);
+ static HANDLE ReconnectAfterShutdown(HANDLE & sock, PADDRINFO remoteItem);
+ static PCASC_SOCKET New(PADDRINFO remoteList, PADDRINFO remoteItem, const char * hostName, unsigned portNum, HANDLE sock);
static PCASC_SOCKET Connect(const char * hostName, unsigned portNum);
// Frees all resources and deletes the socket
@@ -76,7 +72,7 @@ class CASC_SOCKET
PADDRINFO remoteList; // List of the remote host informations
PADDRINFO remoteItem; // The particular host picked during the last connection attempt
CASC_LOCK Lock; // Lock for single threaded access
- SOCKET sock; // Opened and connected socket
+ HANDLE sock; // Opened and connected socket
DWORD dwRefCount; // Number of references
DWORD portNum; // Port number
char hostName[1]; // Buffer for storing remote host (variable length)