Mercurial > hg > nginx
comparison src/os/win32/ngx_socket.c @ 3:34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 20 Aug 2002 14:48:28 +0000 |
parents | ffffe1499bce |
children | e8cdc2989cee |
comparison
equal
deleted
inserted
replaced
2:ffffe1499bce | 3:34a521b1a148 |
---|---|
1 #include <nxg_config.h> | 1 #include <ngx_config.h> |
2 | 2 |
3 #include <nxg_log.h> | 3 #include <ngx_log.h> |
4 #include <nxg_errno.h> | 4 #include <ngx_errno.h> |
5 #include <nxg_socket.h> | 5 #include <ngx_socket.h> |
6 | 6 |
7 | 7 |
8 void ngx_init_sockets(ngx_log_t *log) | 8 void ngx_init_sockets(ngx_log_t *log) |
9 { | 9 { |
10 WSADATA wsd; | 10 WSADATA wsd; |
11 | 11 |
12 if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) | 12 if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) |
13 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, | 13 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, |
14 "ngx_init_sockets: WSAStartup failed"); | 14 "ngx_init_sockets: WSAStartup failed"); |
15 | |
16 /* get AcceptEx(), TransmitFile() functions */ | |
15 } | 17 } |
16 | 18 |
17 int ngx_nonblocking(ngx_socket_t s) | 19 int ngx_nonblocking(ngx_socket_t s) |
18 { | 20 { |
19 unsigned long nb = 1; | 21 unsigned long nb = 1; |
20 | 22 |
21 return ioctlsocket(s, FIONBIO, &nb); | 23 return ioctlsocket(s, FIONBIO, &nb); |
22 } | 24 } |
25 | |
26 int ngx_blocking(ngx_socket_t s) | |
27 { | |
28 unsigned long nb = 0; | |
29 | |
30 return ioctlsocket(s, FIONBIO, &nb); | |
31 } |