mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-06 11:22:26 +08:00
1bf3ad2426
* Actually drop the connection when no response to ping arrives within the next interval. * Avoid sending immediate ping when wall time is adjusted, it's usually spurious. PUBLISHED_FROM=8049280b58edfb94dd0fcb6a1e89ffefe69bcea1
3.0 KiB
3.0 KiB
title | decl_name | symbol_kind | signature |
---|---|---|---|
struct mg_connection | struct mg_connection | struct | struct mg_connection { struct mg_connection *next, *prev; /* mg_mgr::active_connections linkage */ struct mg_connection *listener; /* Set only for accept()-ed connections */ struct mg_mgr *mgr; /* Pointer to containing manager */ sock_t sock; /* Socket to the remote peer */ int err; union socket_address sa; /* Remote peer address */ size_t recv_mbuf_limit; /* Max size of recv buffer */ struct mbuf recv_mbuf; /* Received data */ struct mbuf send_mbuf; /* Data scheduled for sending */ time_t last_io_time; /* Timestamp of the last socket IO */ double ev_timer_time; /* Timestamp of the future MG_EV_TIMER */ mg_event_handler_t proto_handler; /* Protocol-specific event handler */ void *proto_data; /* Protocol-specific data */ void (*proto_data_destructor)(void *proto_data); mg_event_handler_t handler; /* Event handler function */ void *user_data; /* User-specific data */ union { void *v; /* * the C standard is fussy about fitting function pointers into * void pointers, since some archs might have fat pointers for functions. */ mg_event_handler_t f; } priv_1; void *priv_2; void *mgr_data; /* Implementation-specific event manager's data. */ struct mg_iface *iface; unsigned long flags; /* Flags set by Mongoose */ #define MG_F_LISTENING (1 << 0) /* This connection is listening */ #define MG_F_UDP (1 << 1) /* This connection is UDP */ #define MG_F_RESOLVING (1 << 2) /* Waiting for async resolver */ #define MG_F_CONNECTING (1 << 3) /* connect() call in progress */ #define MG_F_SSL (1 << 4) /* SSL is enabled on the connection */ #define MG_F_SSL_HANDSHAKE_DONE (1 << 5) /* SSL hanshake has completed */ #define MG_F_WANT_READ (1 << 6) /* SSL specific */ #define MG_F_WANT_WRITE (1 << 7) /* SSL specific */ #define MG_F_IS_WEBSOCKET (1 << 8) /* Websocket specific */ #define MG_F_RECV_AND_CLOSE (1 << 9) /* Drain rx and close the connection. */ /* Flags that are settable by user */ #define MG_F_SEND_AND_CLOSE (1 << 10) /* Push remaining data and close */ #define MG_F_CLOSE_IMMEDIATELY (1 << 11) /* Disconnect */ /* Flags for protocol handlers */ #define MG_F_PROTO_1 (1 << 12) #define MG_F_PROTO_2 (1 << 13) #define MG_F_ENABLE_BROADCAST (1 << 14) /* Allow broadcast address usage */ /* Flags left for application */ #define MG_F_USER_1 (1 << 20) #define MG_F_USER_2 (1 << 21) #define MG_F_USER_3 (1 << 22) #define MG_F_USER_4 (1 << 23) #define MG_F_USER_5 (1 << 24) #define MG_F_USER_6 (1 << 25) #if MG_ENABLE_SSL void *ssl_if_data; /* SSL library data. */ #else void *unused_ssl_if_data; /* To keep the size of the structure the same. */ #endif }; |
Mongoose connection.