#include <Server.h>
Public Types | |
using | endpoint = boost::asio::ip::tcp::endpoint |
using | protocol_type = endpoint::protocol_type |
Public Member Functions | |
endpoint | GetLocalEndpoint () const |
bool | IsSynchronousMode () const |
template<typename FunctorT1 , typename FunctorT2 > | |
void | Listen (FunctorT1 on_session_opened, FunctorT2 on_session_closed) |
Start listening for connections. More... | |
Server (boost::asio::io_context &io_context, endpoint ep) | |
void | SetSynchronousMode (bool is_synchro) |
void | SetTimeout (time_duration timeout) |
Set session time-out. More... | |
Private Member Functions | |
void | OpenSession (time_duration timeout, ServerSession::callback_function_type on_session_opened, ServerSession::callback_function_type on_session_closed) |
Private Member Functions inherited from carla::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable (NonCopyable &&)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable & | operator= (NonCopyable &&)=delete |
Private Attributes | |
boost::asio::ip::tcp::acceptor | _acceptor |
boost::asio::io_context & | _io_context |
bool | _synchronous |
std::atomic< time_duration > | _timeout |
Definition at line 26 of file streaming/detail/tcp/Server.h.
using carla::streaming::detail::tcp::Server::endpoint = boost::asio::ip::tcp::endpoint |
Definition at line 29 of file streaming/detail/tcp/Server.h.
using carla::streaming::detail::tcp::Server::protocol_type = endpoint::protocol_type |
Definition at line 30 of file streaming/detail/tcp/Server.h.
|
explicit |
Definition at line 20 of file Server.cpp.
|
inline |
Definition at line 34 of file streaming/detail/tcp/Server.h.
References _acceptor.
Referenced by TEST().
|
inline |
Definition at line 61 of file streaming/detail/tcp/Server.h.
References _synchronous, and OpenSession().
Referenced by carla::streaming::detail::tcp::ServerSession::Write().
|
inline |
Start listening for connections.
On each new connection, on_session_opened is called, and on_session_closed when the session is closed.
Definition at line 48 of file streaming/detail/tcp/Server.h.
References _io_context, _timeout, and OpenSession().
Referenced by TEST().
|
private |
Definition at line 26 of file Server.cpp.
References _acceptor, _io_context, and carla::log_error().
Referenced by IsSynchronousMode(), and Listen().
|
inline |
Definition at line 57 of file streaming/detail/tcp/Server.h.
References _synchronous.
|
inline |
Set session time-out.
Applies only to newly created sessions. By default the time-out is set to 10 seconds.
Definition at line 40 of file streaming/detail/tcp/Server.h.
References _timeout.
Referenced by TEST().
|
private |
Definition at line 74 of file streaming/detail/tcp/Server.h.
Referenced by GetLocalEndpoint(), and OpenSession().
|
private |
Definition at line 72 of file streaming/detail/tcp/Server.h.
Referenced by Listen(), and OpenSession().
|
private |
Definition at line 78 of file streaming/detail/tcp/Server.h.
Referenced by IsSynchronousMode(), and SetSynchronousMode().
|
private |
Definition at line 76 of file streaming/detail/tcp/Server.h.
Referenced by Listen(), and SetTimeout().