...
This commit is contained in:
26
tests/adc_netservice_test.cpp
Normal file
26
tests/adc_netservice_test.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <asio/ip/tcp.hpp>
|
||||
|
||||
#include "../net/adc_netproto.h"
|
||||
#include "../net/asio/adc_netservice_asio.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
asio::ip::tcp::endpoint ept_s(asio::ip::tcp::v4(), 9999);
|
||||
asio::ip::tcp::endpoint ept_c(asio::ip::make_address_v4("127.0.0.1"), 9999);
|
||||
|
||||
asio::io_context ctx;
|
||||
|
||||
adc::impl::AdcNetServiceASIOBase<asio::ip::tcp, adc::AdcStopSeqSessionProto<>> srv("TCP NETSERVICE", ctx);
|
||||
|
||||
adc::impl::AdcNetServiceASIOBase<asio::ip::tcp, adc::AdcStopSeqSessionProto<>>::asio_async_ctx_t srv_ctx;
|
||||
srv_ctx.accept_comp_token = [](std::error_code ec) {
|
||||
|
||||
};
|
||||
|
||||
// srv.asyncAccept(ept_s, srv_ctx, std::chrono::seconds(120));
|
||||
srv.asyncConnect(ept_c, srv_ctx);
|
||||
|
||||
ctx.run();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user