...
This commit is contained in:
parent
cbc69bb9ce
commit
672788d59d
@ -267,6 +267,7 @@ public:
|
||||
std::function<void(SocketT*)> onOpen;
|
||||
std::function<void(SocketT*, std::error_code)> onClose;
|
||||
std::function<void(SocketT*, std::span<const char>)> onData;
|
||||
std::function<void(SocketT*, std::error_code)> onError;
|
||||
};
|
||||
|
||||
|
||||
@ -277,6 +278,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void stop() {}
|
||||
|
||||
protected:
|
||||
ServerControls _serverControls;
|
||||
};
|
||||
|
||||
@ -43,10 +43,7 @@ public:
|
||||
template <std::convertible_to<async_accept_callback_t> TokenT>
|
||||
auto asyncAccept(TokenT&& token, const traits::adc_time_duration_c auto& timeout = DEFAULT_ACCEPT_TIMEOUT)
|
||||
{
|
||||
_uwsApp.ws("/*", {.open = [wrapper = traits::adc_pf_wrapper(std::forward<TokenT>(token)), this](auto) {
|
||||
std::get<0>(wrapper)(std::error_code{}, std::make_shared<AdcNetServiceUWS>(_uwsApp));
|
||||
}});
|
||||
|
||||
// just call listen method
|
||||
_uwsApp.listen(_endpoint.first, _endpoint.second,
|
||||
[wrapper = traits::adc_pf_wrapper(std::forward<TokenT>(token)), this](auto* sock) {
|
||||
std::error_code ec;
|
||||
@ -57,6 +54,12 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
template <traits::adc_time_duration_c DT = decltype(DEFAULT_ACCEPT_TIMEOUT)>
|
||||
auto accept(const DT& timeout = DEFAULT_ACCEPT_TIMEOUT)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
uWS::SSLApp& _uwsApp;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user