n3rv::servicecontroller

class n3rv::servicecontroller

servicecontroller is the directory service that:

  • Maintains the full list of available endpoints.
  • Propagates the available endpoints to every online nodes.

Public Functions

n3rv::servicecontrollerservicecontroller(const char *binding_addr, unsigned int binding_port, logger *ll = nullptr)

service controller class constructor.

Parameters
  • binding_addr: Ip address the controller must listen to (0.0.0.0 for listen all)
  • binding_port: TCP port to bind controller on.

int n3rv::servicecontrollerload_topology(std::string path)

Loads a topology file for the service controller to distribute

void n3rv::servicecontrollerrun()

Runs the service controller once instanciated.

void n3rv::servicecontrollerstop()

Stops the service controller main loop.

std::thread *n3rv::servicecontrollerrun_async()

Asynchronously runs the service controller, returns a handler for the running thread.

void n3rv::servicecontrollerterminate()

Stops the binding of CH1/CH2 sockets.

Protected Functions

std::string n3rv::servicecontrollerpeer_ip(zmq::message_t *zmsg)

Retrieves the sender’s ip in order to advertise endpoint

Return
send’s ip string.
Parameters
  • zmsg: originating ZMQ message.