Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ngx_connection.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) Nginx, Inc.
5  */
6 
7 
8 #ifndef _NGX_CONNECTION_H_INCLUDED_
9 #define _NGX_CONNECTION_H_INCLUDED_
10 
11 
12 #include <ngx_config.h>
13 #include <ngx_core.h>
14 
15 
17 
20 
21  struct sockaddr *sockaddr;
22  socklen_t socklen; /* size of sockaddr */
25 
26  int type;
27 
28  int backlog;
29  int rcvbuf;
30  int sndbuf;
31 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
32  int keepidle;
33  int keepintvl;
34  int keepcnt;
35 #endif
36 
37  /* handler of accepted connection */
39 
40  void *servers; /* array of ngx_http_in_addr_t, for example */
41 
44 
45  size_t pool_size;
46  /* should be here because of the AcceptEx() preread */
48  /* should be here because of the deferred accept */
50 
53 
54  unsigned open:1;
55  unsigned remain:1;
56  unsigned ignore:1;
57 
58  unsigned bound:1; /* already bound */
59  unsigned inherited:1; /* inherited from previous process */
60  unsigned nonblocking_accept:1;
61  unsigned listen:1;
62  unsigned nonblocking:1;
63  unsigned shared:1; /* shared between threads or processes */
64  unsigned addr_ntop:1;
65 
66 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
67  unsigned ipv6only:1;
68 #endif
69  unsigned keepalive:2;
70 
71 #if (NGX_HAVE_DEFERRED_ACCEPT)
72  unsigned deferred_accept:1;
73  unsigned delete_deferred:1;
74  unsigned add_deferred:1;
75 #ifdef SO_ACCEPTFILTER
76  char *accept_filter;
77 #endif
78 #endif
79 #if (NGX_HAVE_SETFIB)
80  int setfib;
81 #endif
82 
83 };
84 
85 
86 typedef enum {
93 
94 
95 typedef enum {
100 
101 
102 typedef enum {
107 
108 
109 #define NGX_LOWLEVEL_BUFFERED 0x0f
110 #define NGX_SSL_BUFFERED 0x01
111 
112 
114  void *data;
117 
119 
124 
126 
127  off_t sent;
128 
130 
132 
134  socklen_t socklen;
136 
137 #if (NGX_SSL)
139 #endif
140 
142 
144 
146 
148 
150 
151  unsigned buffered:8;
152 
153  unsigned log_error:3; /* ngx_connection_log_error_e */
154 
155  unsigned unexpected_eof:1;
156  unsigned timedout:1;
157  unsigned error:1;
158  unsigned destroyed:1;
159 
160  unsigned idle:1;
161  unsigned reusable:1;
162  unsigned close:1;
163 
164  unsigned sendfile:1;
165  unsigned sndlowat:1;
166  unsigned tcp_nodelay:2; /* ngx_connection_tcp_nodelay_e */
167  unsigned tcp_nopush:2; /* ngx_connection_tcp_nopush_e */
168 
169 #if (NGX_HAVE_IOCP)
170  unsigned accept_context_updated:1;
171 #endif
172 
173 #if (NGX_HAVE_AIO_SENDFILE)
174  unsigned aio_sendfile:1;
175  ngx_buf_t *busy_sendfile;
176 #endif
177 
178 #if (NGX_THREADS)
179  ngx_atomic_t lock;
180 #endif
181 };
182 
183 
184 ngx_listening_t *ngx_create_listening(ngx_conf_t *cf, void *sockaddr,
185  socklen_t socklen);
192  ngx_uint_t port);
194 
197 
199 
200 #endif /* _NGX_CONNECTION_H_INCLUDED_ */