chore: more info in disconnect
This commit is contained in:
parent
33e2bae05b
commit
785ac29419
1 changed files with 10 additions and 1 deletions
|
|
@ -120,21 +120,30 @@ void connect(String const &url) {
|
|||
}
|
||||
|
||||
void disconnect() {
|
||||
print_line("Client: disconnecting...");
|
||||
if (connection) {
|
||||
connection->stop_threads = true;
|
||||
print_line("Client: stopping threads...");
|
||||
if (receive_thread && receive_thread->joinable()) {
|
||||
receive_thread->join();
|
||||
}
|
||||
print_line("Client: receive thread stopped.");
|
||||
print_line("Client: threads stopped.");
|
||||
print_line("Client: closing socket...");
|
||||
if (connection->socket) {
|
||||
connection->socket->close();
|
||||
connection->socket->disconnect(*connection->server);
|
||||
connection->socket.reset();
|
||||
}
|
||||
print_line("Client: socket closed and reset.");
|
||||
print_line("Client: shutting down context...");
|
||||
if (connection->context) {
|
||||
connection->context->shutdown();
|
||||
connection->context.reset();
|
||||
}
|
||||
print_line("Client: context shut down and reset.");
|
||||
}
|
||||
connection.reset();
|
||||
print_line("Client: connection reset.");
|
||||
}
|
||||
|
||||
NetworkData::ConnectionStatus status() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue