cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::servers::Server Class Reference

Class of servers. More...

#include <msgpack_rpc/servers/server.h>

Collaboration diagram for msgpack_rpc::servers::Server:

Public Member Functions

 Server (std::unique_ptr< impl::IServerImpl > impl) noexcept
 Constructor.
std::shared_ptr< executors::IExecutorexecutor ()
 Get the executor.
std::vector< addresses::URIlocal_endpoint_uris ()
 Get the URIs of the local endpoints in this server.
void run_until_signal ()
 Run processing of this server until SIGINT or SIGTERM is received.
void stop ()
 Stop processing of this server.

Private Attributes

std::unique_ptr< impl::IServerImplimpl_
 Object of the internal implementation.

Detailed Description

Class of servers.

Servers can be created using ServerBuilder.

Examples
more_server.cpp, and simple_server.cpp.

Definition at line 37 of file server.h.

Constructor & Destructor Documentation

◆ Server()

msgpack_rpc::servers::Server::Server ( std::unique_ptr< impl::IServerImpl > impl)
inlineexplicitnoexcept

Constructor.

Parameters
[in]implObject of the internal implementation.
Warning
Users should create servers using ServerBuilder instead of this constructor.

Definition at line 47 of file server.h.

Member Function Documentation

◆ executor()

std::shared_ptr< executors::IExecutor > msgpack_rpc::servers::Server::executor ( )
inlinenodiscard

Get the executor.

Returns
Executor.
Note
This function is mainly for testing. So this function may be removed in the future.

Definition at line 82 of file server.h.

◆ local_endpoint_uris()

std::vector< addresses::URI > msgpack_rpc::servers::Server::local_endpoint_uris ( )
inlinenodiscard

Get the URIs of the local endpoints in this server.

Returns
URIs.
Examples
more_server.cpp.

Definition at line 70 of file server.h.

◆ run_until_signal()

void msgpack_rpc::servers::Server::run_until_signal ( )
inline

Run processing of this server until SIGINT or SIGTERM is received.

Note
When this function returns, this server is stopped automatically.
Examples
more_server.cpp, and simple_server.cpp.

Definition at line 63 of file server.h.

◆ stop()

void msgpack_rpc::servers::Server::stop ( )
inline

Stop processing of this server.

Note
Destructing this server without call of this function will automatically stop this server internally.
Examples
more_server.cpp.

Definition at line 56 of file server.h.

Member Data Documentation

◆ impl_

std::unique_ptr<impl::IServerImpl> msgpack_rpc::servers::Server::impl_
private

Object of the internal implementation.

Definition at line 88 of file server.h.


The documentation for this class was generated from the following file: