keepalive handshake: device_type + keepalive negotiation in UDP/TCP INIT
- Добавлен device_type (1 байт, CLIENT_TYPE_*) в INIT_REQUEST и INIT_RESPONSE - Добавлен keepalive_interval (2 байта) в INIT_RESPONSE - STCP handshake расширен с 43 до 46 байт (device_type+keepalive) - negotiate_keepalive(): оба desktop/server → min, иначе (есть mobile) → max - keepalive_interval вынесен в UTUN_INSTANCE для использования в handshake - stcp_client_connect() принимает device_type и keepalive_interval - peer_device_type/peer_keepalive_interval передаются через stcp_link в ETCP_LINK
This commit is contained in:
1 parent
43aca4a41b
commit
0f1bd3d120
37 files changed
+535
-309
No files matched your search
+3
-3
@@ -134,9 +134,8 @@ struct UTUN_INSTANCE {
|
||||
struct memory_pool* pkt_pool;
|
||||
struct memory_pool* ack_pool;
|
||||
|
||||
// Active sockets (UDP)
|
||||
struct ETCP_SOCKET* etcp_sockets;// linked-list (UDP + TCP is_tcp=1)
|
||||
struct ETCP_SOCKET* tcp_sockets; // linked-list (TCP, filtered by is_tcp=1)
|
||||
// Active sockets (UDP + TCP, is_tcp=1 flag)
|
||||
struct ETCP_SOCKET* etcp_sockets;// linked-list (UDP + TCP)
|
||||
struct stcp_server *stcp_servers; // TCP servers linked list (via stcp_link.c)
|
||||
void* socket_monitor; // SOCKET_MONITOR* (opaque, transport_layer/socket_monitor.c)
|
||||
void* auto_socket_state; // AUTO_SOCKET* (opaque, transport_layer/auto_socket.c)
|
||||
@@ -187,6 +186,7 @@ struct UTUN_INSTANCE {
|
||||
struct broadcast_ctx* broadcast; // Broadcast protocol instance handler (ETCP_ID_BROADCAST dispatcher)
|
||||
|
||||
uint8_t client_type; // CLIENT_TYPE_SERVER/DESKTOP/MOBILE (from config)
|
||||
uint16_t keepalive_interval; // желаемый keepalive (ms), из конфига. для handshake
|
||||
uint8_t client_activity; // CLIENT_ACTIVITY_STANDBY/ACTIVE
|
||||
void* client_activity_timer; // uasync timer handle for inactivity timeout
|
||||
|
||||
|
||||
Reference in new issue
Block a user