File tree Expand file tree Collapse file tree 5 files changed +7
-5
lines changed
include/cucumber-cpp/internal/connectors/wire Expand file tree Collapse file tree 5 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ endif()
4141
4242if (CUKE_STRICT)
4343 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
44+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASIO_NO_DEPRECATED" )
4445endif ()
4546
4647set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /cmake/modules)
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class CUCUMBER_CPP_EXPORT SocketServer {
2929
3030protected:
3131 const ProtocolHandler* protocolHandler;
32- asio::io_service ios;
32+ asio::io_context ios;
3333
3434 template <typename Protocol>
3535 void doListen (
Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ void SocketServer::doListen(
2323
2424template <typename Protocol>
2525void 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));
2829 processStream (stream);
2930}
3031
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ void acceptWireProtocol(
3131 {
3232 TCPSocketServer* const tcpServer = new TCPSocketServer (&protocolHandler);
3333 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));
3535 if (verbose)
3636 std::clog << " Listening on " << tcpServer->listenEndpoint () << std::endl;
3737 }
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ class TCPSocketServerLocalhostTest : public SocketServerTest {
141141
142142 SocketServer* createListeningServer () override {
143143 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 ));
145145 return server.get ();
146146 }
147147
You can’t perform that action at this time.
0 commit comments