nginx/src/os/win32/ngx_socket.h

51 lines
1.1 KiB
C
Raw Normal View History

2002-08-16 23:27:03 +08:00
#ifndef _NGX_SOCKET_H_INCLUDED_
#define _NGX_SOCKET_H_INCLUDED_
#include <ngx_config.h>
2003-06-03 23:42:58 +08:00
#include <ngx_core.h>
2002-08-16 23:27:03 +08:00
2002-09-16 23:01:44 +08:00
#define NGX_WRITE_SHUTDOWN SD_SEND
2002-09-02 22:48:24 +08:00
2002-08-20 22:48:28 +08:00
typedef SOCKET ngx_socket_t;
2002-09-02 22:48:24 +08:00
typedef int socklen_t;
2002-08-16 23:27:03 +08:00
2003-11-17 05:49:42 +08:00
#define ngx_socket(af, type, proto, flags) socket(af, type, proto)
#if 0
2002-08-26 23:18:19 +08:00
#define ngx_socket(af, type, proto, flags) \
WSASocket(af, type, proto, NULL, 0, flags)
2003-11-17 05:49:42 +08:00
#endif
2003-06-11 23:28:34 +08:00
2002-08-26 23:18:19 +08:00
#define ngx_socket_n "WSASocket()"
2002-09-02 22:48:24 +08:00
int ngx_nonblocking(ngx_socket_t s);
2003-02-07 01:21:13 +08:00
int ngx_blocking(ngx_socket_t s);
2002-08-26 23:18:19 +08:00
#define ngx_nonblocking_n "ioctlsocket(FIONBIO)"
2003-02-07 01:21:13 +08:00
#define ngx_blocking_n "ioctlsocket(!FIONBIO)"
2002-08-16 23:27:03 +08:00
2002-09-16 23:01:44 +08:00
#define ngx_shutdown_socket shutdown
#define ngx_shutdown_socket_n "shutdown()"
2002-08-20 22:48:28 +08:00
#define ngx_close_socket closesocket
2002-08-26 23:18:19 +08:00
#define ngx_close_socket_n "closesocket()"
2002-08-16 23:27:03 +08:00
2003-02-07 01:21:13 +08:00
extern LPFN_ACCEPTEX acceptex;
extern LPFN_GETACCEPTEXSOCKADDRS getacceptexsockaddrs;
extern LPFN_TRANSMITFILE transmitfile;
2002-09-02 22:48:24 +08:00
2003-11-17 05:49:42 +08:00
static ngx_inline int ngx_tcp_push(ngx_socket_t s) {
2003-06-11 23:28:34 +08:00
return 0;
}
#define ngx_tcp_push_n "tcp_push()"
2002-08-16 23:27:03 +08:00
#endif /* _NGX_SOCKET_H_INCLUDED_ */