Disconnect from server
| 741 | |
| 742 | // Disconnect from server |
| 743 | void Disconnect() |
| 744 | { |
| 745 | // If connection exists, and it's connected then... |
| 746 | if(IsConnected()) |
| 747 | { |
| 748 | // ...disconnect from server gracefully |
| 749 | m_connection->Disconnect(); |
| 750 | } |
| 751 | |
| 752 | // Either way, we're also done with the asio context... |
| 753 | m_context.stop(); |
| 754 | // ...and its thread |
| 755 | if (thrContext.joinable()) |
| 756 | thrContext.join(); |
| 757 | |
| 758 | // Destroy the connection object |
| 759 | m_connection.release(); |
| 760 | } |
| 761 | |
| 762 | // Check if client is actually connected to a server |
| 763 | bool IsConnected() |
nothing calls this directly
no test coverage detected