NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::Network::ZmqServer Class Reference

ZMQ server on hostname:port with numNetworkThreads i/o threads and a set of callbacks in exchangeProtocol. This class is not copyable. More...

#include <ZmqServer.hpp>

Public Member Functions

 ZmqServer (std::string hostname, uint16_t requestedPort, uint16_t numNetworkThreads, ExchangeProtocol &exchangeProtocol, Runtime::BufferManagerPtr bufferManager)
 
 ~ZmqServer ()
 
bool start ()
 
bool stop ()
 
std::shared_ptr< zmq::context_t > getContext ()
 
bool isServerRunning () const
 
uint16_t getServerPort () const
 
std::string getHostname () const
 
uint16_t getNumOfThreads () const
 
uint16_t getRequestedPort () const
 
void getServerSocketInfo (std::string &hostname, uint16_t &port)
 Retrieves the current server socket information. More...
 

Detailed Description

ZMQ server on hostname:port with numNetworkThreads i/o threads and a set of callbacks in exchangeProtocol. This class is not copyable.

Constructor & Destructor Documentation

◆ ZmqServer()

NES::Network::ZmqServer::ZmqServer ( std::string  hostname,
uint16_t  requestedPort,
uint16_t  numNetworkThreads,
ExchangeProtocol exchangeProtocol,
Runtime::BufferManagerPtr  bufferManager 
)
explicit

Create a ZMQ server on hostname:port with numNetworkThreads i/o threads and a set of callbacks in exchangeProtocol

Parameters
hostname
port
numNetworkThreads
exchangeProtocol

References NES_DEBUG, and NES_WARNING.

◆ ~ZmqServer()

NES::Network::ZmqServer::~ZmqServer ( )

References stop().

Here is the call graph for this function:

Member Function Documentation

◆ getContext()

std::shared_ptr<zmq::context_t> NES::Network::ZmqServer::getContext ( )
inline

Get the global zmq context

Returns

◆ getHostname()

std::string NES::Network::ZmqServer::getHostname ( ) const
inline

Returns the hostname

Returns
the current hostname

◆ getNumOfThreads()

uint16_t NES::Network::ZmqServer::getNumOfThreads ( ) const
inline

Returns the hostname

Returns
the current hostname

◆ getRequestedPort()

uint16_t NES::Network::ZmqServer::getRequestedPort ( ) const
inline

Returns the hostname

Returns
the current hostname

◆ getServerPort()

uint16_t NES::Network::ZmqServer::getServerPort ( ) const
inline

Returns the current server port

Returns
the current server port

Referenced by NES::Network::TEST_F().

Here is the caller graph for this function:

◆ getServerSocketInfo()

void NES::Network::ZmqServer::getServerSocketInfo ( std::string &  hostname,
uint16_t &  port 
)

Retrieves the current server socket information.

Parameters
hostnamethe hostname in use
portthe port in use

◆ isServerRunning()

bool NES::Network::ZmqServer::isServerRunning ( ) const
inline

Checks if the server is running

Returns
true if running

Referenced by NES::Network::TEST_F().

Here is the caller graph for this function:

◆ start()

bool NES::Network::ZmqServer::start ( )

Start the server. It throws exceptions if the starting fails.

References NES_DEBUG, and NES::setThreadName().

Referenced by NES::Network::TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop()

bool NES::Network::ZmqServer::stop ( )

Stop the server. It throws exceptions if the stopping fails.

plz do not change the above shutdown sequence following zmq's guidelines, the correct way to terminate it is to:

  1. call shutdown on the zmq context (this tells ZMQ to prepare for termination)
  2. wait for all zmq sockets and threads to be closed (including the WorkerPool as it holds DataChannels)
  3. call close on the zmq context
  4. deallocate the zmq contect

References NES_DEBUG, NES_ERROR, NES_INFO, and NES_WARNING.

Referenced by ~ZmqServer().

Here is the caller graph for this function:

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