Fix crash in TCP stream disconnect

This commit is contained in:
badaix 2019-11-27 22:58:32 +01:00
parent 5c1f35d6db
commit a625a5d806

View file

@ -45,7 +45,7 @@ TcpStream::TcpStream(PcmListener* pcmListener, boost::asio::io_context& ioc, con
}
LOG(INFO) << "TcpStream port: " << port << "\n";
acceptor_ = make_unique<tcp::acceptor>(ioc_, tcp::endpoint(tcp::v4(), port));
acceptor_ = make_unique<tcp::acceptor>(ioc_, tcp::endpoint(boost::asio::ip::address::from_string(uri_.host), port));
}
@ -69,5 +69,6 @@ void TcpStream::connect()
void TcpStream::disconnect()
{
if (stream_)
stream_->close();
}