Iroha - A simple, decentralized ledger http://iroha.tech
iroha::network::ServerRunner Class Reference

#include "server_runner.hpp"

Collaboration diagram for iroha::network::ServerRunner:
Collaboration graph

Public Member Functions

 ServerRunner (const std::string &address, logger::LoggerPtr log, bool reuse=true, const boost::optional< std::shared_ptr< const TlsCredentials >> &my_tls_creds=boost::none)
 ~ServerRunner ()
ServerRunnerappend (std::shared_ptr< grpc::Service > service)
iroha::expected::Result< int, std::string > run ()
void waitForServersReady ()
void shutdown ()
void shutdown (const std::chrono::system_clock::time_point &deadline)

Detailed Description

Class runs Torii server for handling queries and commands.

Constructor & Destructor Documentation

◆ ServerRunner()

ServerRunner::ServerRunner ( const std::string &  address,
logger::LoggerPtr  log,
bool  reuse = true,
const boost::optional< std::shared_ptr< const TlsCredentials >> &  my_tls_creds = boost::none 

Constructor. Initialize a new instance of ServerRunner class.

address- the address the server will be bind to in URI form
logto print progress to
reuse- allow multiple sockets to bind to the same port
my_tls_creds- TLS credentials_ for this server, if required

◆ ~ServerRunner()

ServerRunner::~ServerRunner ( )
Here is the call graph for this function:

Member Function Documentation

◆ append()

ServerRunner & ServerRunner::append ( std::shared_ptr< grpc::Service >  service)

Adds a new grpc service to be run.

service- service to append.
reference to this with service appended

◆ run()

iroha::expected::Result< int, std::string > ServerRunner::run ( )

Initialize the server and run main loop.

Result with used port number or error message

◆ shutdown() [1/2]

void ServerRunner::shutdown ( )

Ask grpc server to terminate.

Here is the caller graph for this function:

◆ shutdown() [2/2]

void ServerRunner::shutdown ( const std::chrono::system_clock::time_point &  deadline)

Shutdown gRPC server with force on given deadline

◆ waitForServersReady()

void ServerRunner::waitForServersReady ( )

Wait until the server is up.

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