Server.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/network/server/Server.hpp"

Server

Server calls oatpp::network::ConnectionProvider::getConnection() in the loop and passes obtained Connection to oatpp::network::server::ConnectionHandler.

namespace oatpp { namespace network { namespace server { 
  class Server : public base::Countable {}
}}}

Fields

Type Name Summary
const v_int32 STATUS_CREATED Status constant.
const v_int32 STATUS_RUNNING Status constant.
const v_int32 STATUS_STOPPING Status constant.
const v_int32 STATUS_DONE Status constant.

Methods

Return Type Name Summary
[none] Server Constructor.
std::shared_ptr<Server> createShared Create shared Server.
void run Call oatpp::network::ConnectionProvider::getConnection() in the loop and passes obtained Connection
void stop Break server loop.
v_int32 getStatus Get server status.

Server::STATUS_CREATED

Status constant.

static const v_int32 STATUS_CREATED

Server::STATUS_RUNNING

Status constant.

static const v_int32 STATUS_RUNNING

Server::STATUS_STOPPING

Status constant.

static const v_int32 STATUS_STOPPING

Server::STATUS_DONE

Status constant.

static const v_int32 STATUS_DONE

Server::Server

Constructor.

Server(const std::shared_ptr<ServerConnectionProvider>& connectionProvider,
       const std::shared_ptr<ConnectionHandler>& connectionHandler)

Server::createShared

Create shared Server.

static std::shared_ptr<Server> createShared(const std::shared_ptr<ServerConnectionProvider>& connectionProvider,
                                            const std::shared_ptr<ConnectionHandler>& connectionHandler)

Server::run

Call oatpp::network::ConnectionProvider::getConnection() in the loop and passes obtained Connection to oatpp::network::server::ConnectionHandler.

void run()

Server::stop

Break server loop. Note: thread can still be blocked on the Server::run() call as it may be waiting for ConnectionProvider to provide connection.

void stop()

Server::getStatus

Get server status.

v_int32 getStatus()