From 76e75b1009d702538f248738b3af0d667fcc4c77 Mon Sep 17 00:00:00 2001 From: "xuan.guo@atomdatatech.com" Date: Tue, 25 Jan 2022 18:20:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=96=B0=E7=89=88=E6=9C=ACbo?= =?UTF-8?q?ost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NetDebugger/SerialPort.cpp | 2 +- NetDebugger/TCPClient.cpp | 2 +- NetDebugger/TCPServer.cpp | 2 +- NetDebugger/TCPSwitch.cpp | 2 +- NetDebugger/UDPStream.cpp | 4 ++-- NetDebugger/Websocket.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NetDebugger/SerialPort.cpp b/NetDebugger/SerialPort.cpp index 567229f..7b2e131 100644 --- a/NetDebugger/SerialPort.cpp +++ b/NetDebugger/SerialPort.cpp @@ -1279,7 +1279,7 @@ class TcpForwardClientChannel : { auto channel = shared_from_this(); boost::system::error_code ec; - auto rslv = std::make_shared(m_Socket.get_io_context()); + auto rslv = std::make_shared(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) diff --git a/NetDebugger/TCPClient.cpp b/NetDebugger/TCPClient.cpp index 0083f70..08da387 100644 --- a/NetDebugger/TCPClient.cpp +++ b/NetDebugger/TCPClient.cpp @@ -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(m_Socket.get_io_context()); + auto rslv = std::make_shared(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) { diff --git a/NetDebugger/TCPServer.cpp b/NetDebugger/TCPServer.cpp index 03e83c0..94d91ef 100644 --- a/NetDebugger/TCPServer.cpp +++ b/NetDebugger/TCPServer.cpp @@ -210,7 +210,7 @@ void TCPServer::Stop(void) TcpChannel::TcpChannel(std::shared_ptr owner) : m_Owner(owner), - m_Socket(owner->m_Acceptor.get_io_context()) + m_Socket(theApp.GetIOContext()) { } diff --git a/NetDebugger/TCPSwitch.cpp b/NetDebugger/TCPSwitch.cpp index db88da7..ef2cd6e 100644 --- a/NetDebugger/TCPSwitch.cpp +++ b/NetDebugger/TCPSwitch.cpp @@ -241,7 +241,7 @@ void TCPForwardServer::StartAcceptClient(void) void TCPForwardServer::ConnectServer(std::shared_ptr self, std::shared_ptr channelClient, std::shared_ptr channelServer) { boost::system::error_code ec; - auto rslv = std::make_shared(self->m_Acceptor.get_io_context()); + auto rslv = std::make_shared(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) { diff --git a/NetDebugger/UDPStream.cpp b/NetDebugger/UDPStream.cpp index 583799e..defe8dd 100644 --- a/NetDebugger/UDPStream.cpp +++ b/NetDebugger/UDPStream.cpp @@ -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; @@ -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; diff --git a/NetDebugger/Websocket.cpp b/NetDebugger/Websocket.cpp index fee915f..e6fa733 100644 --- a/NetDebugger/Websocket.cpp +++ b/NetDebugger/Websocket.cpp @@ -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(GetSocket().get_io_context()); + auto rslv = std::make_shared(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) {