Fixed disconnect issues
This commit is contained in:
parent
09548d6b3b
commit
3e4f553aef
1 changed files with 6 additions and 3 deletions
|
@ -36,7 +36,7 @@ public:
|
||||||
|
|
||||||
~BoostConnection()
|
~BoostConnection()
|
||||||
{
|
{
|
||||||
|
disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void connect(const std::string& server, uint16_t port) override
|
void connect(const std::string& server, uint16_t port) override
|
||||||
|
@ -69,8 +69,11 @@ public:
|
||||||
|
|
||||||
void disconnect() override
|
void disconnect() override
|
||||||
{
|
{
|
||||||
LOG_DEBUG("[%s:%d] Disconnecting", getConnectedIp().c_str(), getConnectedPort());
|
if (isConnected()) {
|
||||||
socket_.get().lowest_layer().close();
|
LOG_DEBUG("[%s:%d] Disconnecting", getConnectedIp().c_str(), getConnectedPort());
|
||||||
|
socket_.get().lowest_layer().close();
|
||||||
|
}
|
||||||
|
|
||||||
ioService_.stop();
|
ioService_.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue