...
This commit is contained in:
parent
a12c186bb3
commit
edb8f4a3ae
@ -31,6 +31,8 @@ set(ADC_NETWORK_HEADERS
|
|||||||
net/adc_netservice.h
|
net/adc_netservice.h
|
||||||
net/adc_endpoint.h
|
net/adc_endpoint.h
|
||||||
net/adc_netserver.h
|
net/adc_netserver.h
|
||||||
|
net/adc_net_concepts.h
|
||||||
|
net/adc_device_netmsg.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -40,8 +42,8 @@ if (ASIO_LIBRARY)
|
|||||||
find_package(ASIO REQUIRED)
|
find_package(ASIO REQUIRED)
|
||||||
|
|
||||||
set(ADC_NETWORK_HEADERS ${ADC_NETWORK_HEADERS}
|
set(ADC_NETWORK_HEADERS ${ADC_NETWORK_HEADERS}
|
||||||
net/adc_netservice_asio.h
|
net/asio/adc_netservice_asio.h
|
||||||
net/adc_netsession_asio.h
|
net/asio/adc_netsession_asio.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_compile_definitions(PUBLIC USE_ASIO_LIBRARY)
|
add_compile_definitions(PUBLIC USE_ASIO_LIBRARY)
|
||||||
|
|||||||
22
net/adc_device_netserver.h
Normal file
22
net/adc_device_netserver.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "adc_netserver.h"
|
||||||
|
|
||||||
|
namespace adc
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
class AdcDeviceNetServer : public AdcGenericNetServer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class Session
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void start() {}
|
||||||
|
void stop() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace adc
|
||||||
@ -244,7 +244,7 @@ protected:
|
|||||||
template <typename SessionT, typename AT, typename IDT, typename CTXT>
|
template <typename SessionT, typename AT, typename IDT, typename CTXT>
|
||||||
void doAccept(std::shared_ptr<AT> acceptor, const IDT& id, const CTXT& sess_ctx)
|
void doAccept(std::shared_ptr<AT> acceptor, const IDT& id, const CTXT& sess_ctx)
|
||||||
{
|
{
|
||||||
acceptor.asyncAccept([acceptor, &id, &sess_ctx, this](auto ec, typename SessionT::netservice_t srv) mutable {
|
acceptor->asyncAccept([acceptor, &id, &sess_ctx, this](auto ec, typename SessionT::netservice_t srv) mutable {
|
||||||
if (!ec) {
|
if (!ec) {
|
||||||
auto sess = std::make_shared<SessionT>(id, std::move(srv), sess_ctx);
|
auto sess = std::make_shared<SessionT>(id, std::move(srv), sess_ctx);
|
||||||
startSession(sess);
|
startSession(sess);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user