File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,14 +125,12 @@ class Server
125125 Server& operator = ( const Server& ) = delete ;
126126
127127 Server (typename ASIOLIB::ContextType& ios, unsigned short port) :
128- acceptor (ios, asiolib::ip::tcp::endpoint(asiolib::ip::tcp::v4(), port)),
129- socket (ios)
128+ acceptor (ios, asiolib::ip::tcp::endpoint(asiolib::ip::tcp::v4(), port))
130129 {
131130 Accept ();
132131 }
133132 Server (typename ASIOLIB::ContextType& ios, std::string address, unsigned short port) :
134- acceptor (ios, asiolib::ip::tcp::endpoint(ASIOLIB::IpAddressFromString(address), port)),
135- socket (ios)
133+ acceptor (ios, asiolib::ip::tcp::endpoint(ASIOLIB::IpAddressFromString(address), port))
136134 {
137135 Accept ();
138136 }
@@ -142,16 +140,16 @@ class Server
142140private:
143141 void Accept ()
144142 {
145- acceptor.async_accept (socket, [this ](asiolibec::error_code ec)
143+ acceptor.async_accept ([this ](asiolibec::error_code ec, asiolib::ip::tcp::socket socket )
146144 {
147145 if (!ec) CreateSession (std::move (socket))->Start ();
148146 Accept ();
149147 });
150148 }
151149 asiolib::ip::tcp::acceptor acceptor;
152- asiolib::ip::tcp::socket socket;
153150};
154151
152+
155153} // namespace detail
156154} // namespace cli
157155
You can’t perform that action at this time.
0 commit comments