Mercurial > hg > nginx
comparison src/os/win32/ngx_socket.h @ 7444:4089b3d2cb59
Win32: added WSAPoll() support.
WSAPoll() is only available with Windows Vista and newer (and only
available during compilation if _WIN32_WINNT >= 0x0600). To make
sure the code works with Windows XP, we do not redefine _WIN32_WINNT,
but instead load WSAPoll() dynamically if it is not available during
compilation.
Also, sockets are not guaranteed to be small integers on Windows.
So an index array is used instead of NGX_USE_FD_EVENT to map
events to connections.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 24 Jan 2019 21:51:21 +0300 |
parents | 2a621245f4cf |
children | efd71d49bde0 |
comparison
equal
deleted
inserted
replaced
7443:f3ff79ae31d9 | 7444:4089b3d2cb59 |
---|---|
198 extern LPFN_TRANSMITPACKETS ngx_transmitpackets; | 198 extern LPFN_TRANSMITPACKETS ngx_transmitpackets; |
199 extern LPFN_CONNECTEX ngx_connectex; | 199 extern LPFN_CONNECTEX ngx_connectex; |
200 extern LPFN_DISCONNECTEX ngx_disconnectex; | 200 extern LPFN_DISCONNECTEX ngx_disconnectex; |
201 | 201 |
202 | 202 |
203 #if (NGX_HAVE_POLL && !defined POLLIN) | |
204 | |
205 /* | |
206 * WSAPoll() is only available if _WIN32_WINNT >= 0x0600. | |
207 * If it is not available during compilation, we try to | |
208 * load it dynamically at runtime. | |
209 */ | |
210 | |
211 #define NGX_LOAD_WSAPOLL 1 | |
212 | |
213 #define POLLRDNORM 0x0100 | |
214 #define POLLRDBAND 0x0200 | |
215 #define POLLIN (POLLRDNORM | POLLRDBAND) | |
216 #define POLLPRI 0x0400 | |
217 | |
218 #define POLLWRNORM 0x0010 | |
219 #define POLLOUT (POLLWRNORM) | |
220 #define POLLWRBAND 0x0020 | |
221 | |
222 #define POLLERR 0x0001 | |
223 #define POLLHUP 0x0002 | |
224 #define POLLNVAL 0x0004 | |
225 | |
226 typedef struct pollfd { | |
227 | |
228 SOCKET fd; | |
229 SHORT events; | |
230 SHORT revents; | |
231 | |
232 } WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD; | |
233 | |
234 typedef int (WSAAPI *ngx_wsapoll_pt)( | |
235 LPWSAPOLLFD fdArray, | |
236 ULONG fds, | |
237 INT timeout | |
238 ); | |
239 | |
240 extern ngx_wsapoll_pt WSAPoll; | |
241 extern ngx_uint_t ngx_have_wsapoll; | |
242 | |
243 #endif | |
244 | |
245 | |
203 int ngx_tcp_push(ngx_socket_t s); | 246 int ngx_tcp_push(ngx_socket_t s); |
204 #define ngx_tcp_push_n "tcp_push()" | 247 #define ngx_tcp_push_n "tcp_push()" |
205 | 248 |
206 | 249 |
207 #endif /* _NGX_SOCKET_H_INCLUDED_ */ | 250 #endif /* _NGX_SOCKET_H_INCLUDED_ */ |