Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ endif()

if(CUKE_STRICT)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASIO_NO_DEPRECATED")
endif()

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CUCUMBER_CPP_EXPORT SocketServer {

protected:
const ProtocolHandler* protocolHandler;
asio::io_service ios;
asio::io_context ios;

template<typename Protocol>
void doListen(
Expand Down
5 changes: 3 additions & 2 deletions src/connectors/wire/WireServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ void SocketServer::doListen(

template<typename Protocol>
void SocketServer::doAcceptOnce(asio::basic_socket_acceptor<Protocol>& acceptor) {
typename Protocol::iostream stream;
acceptor.accept(*stream.rdbuf());
typename Protocol::socket socket(ios);
acceptor.accept(socket);
typename Protocol::iostream stream(std::move(socket));
processStream(stream);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void acceptWireProtocol(
{
TCPSocketServer* const tcpServer = new TCPSocketServer(&protocolHandler);
server.reset(tcpServer);
tcpServer->listen(asio::ip::tcp::endpoint(asio::ip::address::from_string(host), port));
tcpServer->listen(asio::ip::tcp::endpoint(asio::ip::make_address(host), port));
if (verbose)
std::clog << "Listening on " << tcpServer->listenEndpoint() << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/WireServerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class TCPSocketServerLocalhostTest : public SocketServerTest {

SocketServer* createListeningServer() override {
server.reset(new TCPSocketServer(&protocolHandler));
server->listen(asio::ip::tcp::endpoint(asio::ip::address::from_string("127.0.0.1"), 0));
server->listen(asio::ip::tcp::endpoint(asio::ip::make_address("127.0.0.1"), 0));
return server.get();
}

Expand Down