Skip to content

Commit dbaca1e

Browse files
committed
Added tests/daemon_test.cpp
1 parent 1e652a0 commit dbaca1e

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

daemon/tests/daemon_test.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,14 @@ struct Client {
9797
socket_.set_option(udp::socket::reuse_address(true));
9898
socket_.bind(listen_endpoint_);
9999
socket_.set_option(
100+
#if BOOST_VERSION < 108700
101+
multicast::join_group(address::from_string(g_sap_address).to_v4(),
102+
address::from_string(g_daemon_address).to_v4())
103+
#else
100104
multicast::join_group(make_address(g_sap_address).to_v4(),
101-
make_address(g_daemon_address).to_v4()));
102-
105+
make_address(g_daemon_address).to_v4())
106+
#endif
107+
);
103108
cli_.set_connection_timeout(30);
104109
cli_.set_read_timeout(30);
105110
cli_.set_write_timeout(30);
@@ -362,10 +367,18 @@ struct Client {
362367

363368
private:
364369
httplib::Client cli_{g_daemon_address, g_daemon_port};
370+
#if BOOST_VERSION < 108700
371+
io_service io_service_;
372+
#else
365373
io_context io_service_;
374+
#endif
366375
udp::socket socket_{io_service_};
367376
udp::endpoint listen_endpoint_{
377+
#if BOOST_VERSION < 108700
378+
udp::endpoint(address::from_string("0.0.0.0"), g_sap_port)};
379+
#else
368380
udp::endpoint(make_address("0.0.0.0"), g_sap_port)};
381+
#endif
369382
};
370383

371384
BOOST_AUTO_TEST_CASE(is_alive) {

0 commit comments

Comments
 (0)