blob: d0e547ca65dee30afcf2569de5b46ad3861c0c39 (
plain)
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
|
#include <ngx_config.h>
#include <ngx_log.h>
#include <ngx_errno.h>
#include <ngx_socket.h>
void ngx_init_sockets(ngx_log_t *log)
{
WSADATA wsd;
if (WSAStartup(MAKEWORD(2,2), &wsd) != 0)
ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
"ngx_init_sockets: WSAStartup failed");
/* get AcceptEx(), TransmitFile() functions */
}
int ngx_nonblocking(ngx_socket_t s)
{
unsigned long nb = 1;
return ioctlsocket(s, FIONBIO, &nb);
}
int ngx_blocking(ngx_socket_t s)
{
unsigned long nb = 0;
return ioctlsocket(s, FIONBIO, &nb);
}
|