-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmg_socket.h
More file actions
24 lines (21 loc) · 807 Bytes
/
mg_socket.h
File metadata and controls
24 lines (21 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Unified socket address. For IPv6 support, add IPv6 address structure
// in the union u.
union usa {
struct sockaddr sa;
struct sockaddr_in sin;
#if defined(USE_IPV6)
struct sockaddr_in6 sin6;
#endif
};
// Describes listening socket, or socket which was accept()-ed by the master
// thread and queued for future handling by the worker thread.
struct socket {
struct socket *next; // Linkage
SOCKET sock; // Listening socket
union usa lsa; // Local socket address
union usa rsa; // Remote socket address
int is_ssl; // Is socket SSL-ed
};
REPLACE_STATIC int parse_port_string(const struct vec *vec, struct socket *so);
REPLACE_STATIC void close_all_listening_sockets(struct mg_context *ctx);
REPLACE_STATIC int set_ports_option(struct mg_context *ctx);