|
|
|
@ -222,6 +222,18 @@ void etcpmon_client_disconnect(struct etcpmon_client* client) { |
|
|
|
client->fully_connected = 0; |
|
|
|
client->fully_connected = 0; |
|
|
|
client->recv_len = 0; |
|
|
|
client->recv_len = 0; |
|
|
|
client->selected_peer_id = 0; |
|
|
|
client->selected_peer_id = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Очистить очередь pending requests и сбросить seq_id */ |
|
|
|
|
|
|
|
struct etcpmon_pending_request* req = client->pending_head; |
|
|
|
|
|
|
|
while (req) { |
|
|
|
|
|
|
|
struct etcpmon_pending_request* next = req->next; |
|
|
|
|
|
|
|
free(req); |
|
|
|
|
|
|
|
req = next; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
client->pending_head = NULL; |
|
|
|
|
|
|
|
client->pending_tail = NULL; |
|
|
|
|
|
|
|
client->next_seq_id = 1; |
|
|
|
|
|
|
|
client->last_response_seq_id = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int etcpmon_client_is_connected(const struct etcpmon_client* client) { |
|
|
|
int etcpmon_client_is_connected(const struct etcpmon_client* client) { |
|
|
|
|