Skip to content

Commit

Permalink
Merge pull request #8 from kkzi/main
Browse files Browse the repository at this point in the history
适配新版本boost
  • Loading branch information
Zhou-zhi-peng authored Jan 26, 2022
2 parents 5bbdbca + 76e75b1 commit 752a32d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion NetDebugger/SerialPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ class TcpForwardClientChannel :
{
auto channel = shared_from_this();
boost::system::error_code ec;
auto rslv = std::make_shared<boost::asio::ip::tcp::resolver>(m_Socket.get_io_context());
auto rslv = std::make_shared<boost::asio::ip::tcp::resolver>(theApp.GetIOContext());
boost::asio::ip::tcp::resolver::query qry(WStringToString(m_ServerURL), std::to_string(m_RemotePort));
auto keepAlive = m_Keepalive;
rslv->async_resolve(qry, [rslv, channel, keepAlive, handler](const boost::system::error_code& ec, boost::asio::ip::tcp::resolver::iterator iter)
Expand Down
2 changes: 1 addition & 1 deletion NetDebugger/TCPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void TCPClientChannel::Connect(const std::wstring& host, int port, bool keepAliv
{
auto channel = shared_from_this();
boost::system::error_code ec;
auto rslv = std::make_shared<boost::asio::ip::tcp::resolver>(m_Socket.get_io_context());
auto rslv = std::make_shared<boost::asio::ip::tcp::resolver>(theApp.GetIOContext());
boost::asio::ip::tcp::resolver::query qry(WStringToString(host), std::to_string(port));
rslv->async_resolve(qry, [rslv, channel, keepAlive, handler](const boost::system::error_code &ec, boost::asio::ip::tcp::resolver::iterator iter)
{
Expand Down
2 changes: 1 addition & 1 deletion NetDebugger/TCPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void TCPServer::Stop(void)

TcpChannel::TcpChannel(std::shared_ptr<TCPServer> owner) :
m_Owner(owner),
m_Socket(owner->m_Acceptor.get_io_context())
m_Socket(theApp.GetIOContext())
{

}
Expand Down
2 changes: 1 addition & 1 deletion NetDebugger/TCPSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void TCPForwardServer::StartAcceptClient(void)
void TCPForwardServer::ConnectServer(std::shared_ptr<TCPForwardServer> self, std::shared_ptr<TcpForwardChannel> channelClient, std::shared_ptr<TcpForwardChannel> channelServer)
{
boost::system::error_code ec;
auto rslv = std::make_shared<boost::asio::ip::tcp::resolver>(self->m_Acceptor.get_io_context());
auto rslv = std::make_shared<boost::asio::ip::tcp::resolver>(theApp.GetIOContext());
boost::asio::ip::tcp::resolver::query qry(WStringToString(self->m_RemoteHost), std::to_string(self->m_RemotePort));
rslv->async_resolve(qry, [rslv, self, channelClient, channelServer](const boost::system::error_code &ec, boost::asio::ip::tcp::resolver::iterator iter)
{
Expand Down
4 changes: 2 additions & 2 deletions NetDebugger/UDPStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void UDPBasic::Start(void)
std::thread connectThread([client]()
{
boost::system::error_code ec;
boost::asio::ip::udp::resolver rslv(client->m_Socket.get_io_context());
boost::asio::ip::udp::resolver rslv(theApp.GetIOContext());
boost::asio::ip::udp::resolver::query qry(WStringToString(client->m_RemoteAddress), std::to_string(client->m_RemotePort));
boost::asio::ip::udp::resolver::iterator iter = rslv.resolve(qry, ec);
boost::asio::ip::udp::resolver::iterator end;
Expand Down Expand Up @@ -652,7 +652,7 @@ void UDPClient::Start(void)
std::thread connectThread([client]()
{
boost::system::error_code ec;
boost::asio::ip::udp::resolver rslv(client->m_Socket.get_io_context());
boost::asio::ip::udp::resolver rslv(theApp.GetIOContext());
boost::asio::ip::udp::resolver::query qry(WStringToString(client->m_RemoteAddress), std::to_string(client->m_RemotePort));
boost::asio::ip::udp::resolver::iterator iter = rslv.resolve(qry, ec);
boost::asio::ip::udp::resolver::iterator end;
Expand Down
2 changes: 1 addition & 1 deletion NetDebugger/Websocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ void WebSocketClientChannel::Connect(
m_ConnectQueryString = query;
auto channel = shared_from_this();
boost::system::error_code ec;
auto rslv = std::make_shared<boost::asio::ip::tcp::resolver>(GetSocket().get_io_context());
auto rslv = std::make_shared<boost::asio::ip::tcp::resolver>(theApp.GetIOContext());
boost::asio::ip::tcp::resolver::query qry(host, std::to_string(port));
rslv->async_resolve(qry, [rslv, channel, query, host, port, handler](const boost::system::error_code &ec, boost::asio::ip::tcp::resolver::iterator iter)
{
Expand Down

0 comments on commit 752a32d

Please sign in to comment.