|
Lines 133-138
Link Here
|
| 133 |
struct sockaddr_in serverAddress; |
133 |
struct sockaddr_in serverAddress; |
| 134 |
char localhost[MAX_HOST_NAME_LENGTH+1]; |
134 |
char localhost[MAX_HOST_NAME_LENGTH+1]; |
| 135 |
struct linger linger; |
135 |
struct linger linger; |
|
|
136 |
HANDLE handle; |
| 136 |
|
137 |
|
| 137 |
BZERO(result, sizeof(result)); |
138 |
BZERO(result, sizeof(result)); |
| 138 |
BZERO(&serverAddress, sizeof(serverAddress)); |
139 |
BZERO(&serverAddress, sizeof(serverAddress)); |
|
Lines 217-228
Link Here
|
| 217 |
ra_setLastError(HANDLE_NO_INHERIT_FAILED, errno); |
218 |
ra_setLastError(HANDLE_NO_INHERIT_FAILED, errno); |
| 218 |
return -1; |
219 |
return -1; |
| 219 |
} |
220 |
} |
| 220 |
CreateThread(NULL, /* default security attributes */ |
221 |
handle = CreateThread(NULL, /* default security attributes */ |
| 221 |
0, /* same stack size as current thread */ |
222 |
0, /* same stack size as current thread */ |
| 222 |
win32BoundUDPServerProxy, /* Thread entry point */ |
223 |
win32BoundUDPServerProxy, /* Thread entry point */ |
| 223 |
(LPVOID)result, /* No params */ |
224 |
(LPVOID)result, /* No params */ |
| 224 |
0, /* start executing immediately */ |
225 |
0, /* start executing immediately */ |
| 225 |
&(result->tid)); /* the thread ID */ |
226 |
&(result->tid)); /* the thread ID */ |
|
|
227 |
CloseHandle(handle); |
| 226 |
#else |
228 |
#else |
| 227 |
errno=0; |
229 |
errno=0; |
| 228 |
if(pthread_create(&(result->tid), |
230 |
if(pthread_create(&(result->tid), |
|
Lines 383-388
Link Here
|
| 383 |
int ra_createTCPServer(unsigned short portNum, |
385 |
int ra_createTCPServer(unsigned short portNum, |
| 384 |
ra_serverInfo_t *result) { |
386 |
ra_serverInfo_t *result) { |
| 385 |
|
387 |
|
|
|
388 |
HANDLE handle; |
| 386 |
#ifdef _WIN32 |
389 |
#ifdef _WIN32 |
| 387 |
/* On WinDoze we have to initialize the sockets */ |
390 |
/* On WinDoze we have to initialize the sockets */ |
| 388 |
if(ra_win32InitializeSockets()<0) { |
391 |
if(ra_win32InitializeSockets()<0) { |
|
Lines 392-403
Link Here
|
| 392 |
|
395 |
|
| 393 |
/* Run the server on a separate thread and return the tid */ |
396 |
/* Run the server on a separate thread and return the tid */ |
| 394 |
#ifdef _WIN32 |
397 |
#ifdef _WIN32 |
| 395 |
CreateThread(NULL, /* default security attributes */ |
398 |
handle = CreateThread(NULL, /* default security attributes */ |
| 396 |
0, /* same stack size as current thread */ |
399 |
0, /* same stack size as current thread */ |
| 397 |
win32TCPServerProxy, /* Thread entry point */ |
400 |
win32TCPServerProxy, /* Thread entry point */ |
| 398 |
(LPVOID)result, /* params */ |
401 |
(LPVOID)result, /* params */ |
| 399 |
0, /* start executing immediately */ |
402 |
0, /* start executing immediately */ |
| 400 |
&(result->tid)); /* the thread ID */ |
403 |
&(result->tid)); /* the thread ID */ |
|
|
404 |
CloseHandle(handle); |
| 401 |
#else |
405 |
#else |
| 402 |
errno=0; |
406 |
errno=0; |
| 403 |
if(pthread_create(&(result->tid), |
407 |
if(pthread_create(&(result->tid), |