-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOSNet.c
49 lines (38 loc) · 1.53 KB
/
OSNet.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/***************************************************************************************************************:')
OSNet.c
Network includes, typedefs, defines, initialization and some useful functions.
You must call InitNet() before using any low-level network function.
Fabrice Le Bars
Created : 2007
***************************************************************************************************************:)*/
// Prevent Visual Studio Intellisense from defining _WIN32 and _MSC_VER when we use
// Visual Studio to edit Linux or Borland C++ code.
#ifdef __linux__
# undef _WIN32
#endif // __linux__
#if defined(__GNUC__) || defined(__BORLANDC__)
# undef _MSC_VER
#endif // defined(__GNUC__) || defined(__BORLANDC__)
#include "OSNet.h"
#ifndef DISABLE_THREADS_OSNET
THREAD_PROC_RETURN_VALUE handlecliThreadProc(void* pHandlecliThreadParam)
{
int (*handlecli)(SOCKET, void*) = ((HANDLECLITHREADPARAM*)pHandlecliThreadParam)->handlecli;
SOCKET sockcli = ((HANDLECLITHREADPARAM*)pHandlecliThreadParam)->sockcli;
void* pParam = ((HANDLECLITHREADPARAM*)pHandlecliThreadParam)->pParam;
if (handlecli(sockcli, pParam) != EXIT_SUCCESS)
{
PRINT_DEBUG_WARNING_OSNET(("handlecliThreadProc warning (%s) : %s\n",
strtime_m(),
"Error while communicating with a client. "));
}
free(pHandlecliThreadParam);
if (disconnectclifromtcpsrv(sockcli) != EXIT_SUCCESS)
{
PRINT_DEBUG_WARNING_OSNET(("handlecliThreadProc warning (%s) : %s\n",
strtime_m(),
"Error disconnecting a client. "));
}
return 0;
}
#endif // !DISABLE_THREADS_OSNET