annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
1 #include <ngx_config.h>
2
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2
3
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
3 #include <ngx_log.h>
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
4 #include <ngx_errno.h>
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
5 #include <ngx_socket.h>
2
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 void ngx_init_sockets(ngx_log_t *log)
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 {
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 WSADATA wsd;
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 if (WSAStartup(MAKEWORD(2,2), &wsd) != 0)
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 "ngx_init_sockets: WSAStartup failed");
3
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
15
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
16 /* get AcceptEx(), TransmitFile() functions */
2
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 }
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 int ngx_nonblocking(ngx_socket_t s)
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20 {
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 unsigned long nb = 1;
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23 return ioctlsocket(s, FIONBIO, &nb);
ffffe1499bce nginx-0.0.1-2002-08-16-19:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 }
3
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
25
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
26 int ngx_blocking(ngx_socket_t s)
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
27 {
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
28 unsigned long nb = 0;
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
29
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
30 return ioctlsocket(s, FIONBIO, &nb);
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents: 2
diff changeset
31 }