File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed
include/cucumber-cpp/internal/connectors/wire Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class CUCUMBER_CPP_EXPORT SocketServer {
29
29
30
30
protected:
31
31
const ProtocolHandler* protocolHandler;
32
- asio::io_service ios;
32
+ asio::io_context ios;
33
33
34
34
template <typename Protocol>
35
35
void doListen (
Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ void SocketServer::doListen(
23
23
24
24
template <typename Protocol>
25
25
void SocketServer::doAcceptOnce (asio::basic_socket_acceptor<Protocol>& acceptor) {
26
- typename Protocol::iostream stream;
27
- acceptor.accept (*stream.rdbuf ());
26
+ typename Protocol::socket socket (ios);
27
+ acceptor.accept (socket);
28
+ typename Protocol::iostream stream (std::move (socket));
28
29
processStream (stream);
29
30
}
30
31
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ void acceptWireProtocol(
31
31
{
32
32
TCPSocketServer* const tcpServer = new TCPSocketServer (&protocolHandler);
33
33
server.reset (tcpServer);
34
- tcpServer->listen (asio::ip::tcp::endpoint (asio::ip::address::from_string (host), port));
34
+ tcpServer->listen (asio::ip::tcp::endpoint (asio::ip::make_address (host), port));
35
35
if (verbose)
36
36
std::clog << " Listening on " << tcpServer->listenEndpoint () << std::endl;
37
37
}
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ class TCPSocketServerLocalhostTest : public SocketServerTest {
141
141
142
142
SocketServer* createListeningServer () override {
143
143
server.reset (new TCPSocketServer (&protocolHandler));
144
- server->listen (asio::ip::tcp::endpoint (asio::ip::address::from_string (" 127.0.0.1" ), 0 ));
144
+ server->listen (asio::ip::tcp::endpoint (asio::ip::make_address (" 127.0.0.1" ), 0 ));
145
145
return server.get ();
146
146
}
147
147
You can’t perform that action at this time.
0 commit comments