RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
#include <named_endpoint.h>
Classes | |
struct | Interface |
Public Member Functions | |
void | init (std::shared_ptr< ConfigurationService > config, const std::string &endpointName) |
void | publishAddress (const std::string &address, const Json::Value &addressConfig) |
void | activate () |
std::vector< std::string > | getPublishedUris () const |
Static Public Member Functions | |
static std::string | addrToString (const sockaddr *addr) |
static std::string | addrToIp (const std::string &addr) |
static std::vector< Interface > | getInterfaces (const std::set< int > &families=std::set< int >({AF_INET}), int flagsRequired=IFF_UP, int flagsExcluded=0) |
A endpoint that publishes itself in such a way that other things can connect to it by name.
When we bind the interface, we record where the interface is listening in the configuration service. That way, when something wants to connect to the service it can look up the configuration in the object.
Definition at line 32 of file named_endpoint.h.
void Datacratic::NamedEndpoint::activate | ( | ) |
Publish that the address is active. Atomically causes the endpoint to be reconfigured.
std::string Datacratic::NamedEndpoint::addrToIp | ( | const std::string & | addr | ) | [static] |
Convert a network address to an IP address.
Definition at line 91 of file named_endpoint.cc.
std::string Datacratic::NamedEndpoint::addrToString | ( | const sockaddr * | addr | ) | [static] |
Convert a network address to a string
Definition at line 68 of file named_endpoint.cc.
std::vector< NamedEndpoint::Interface > Datacratic::NamedEndpoint::getInterfaces | ( | const std::set< int > & | families = std::set<int>({ AF_INET }) , |
int | flagsRequired = IFF_UP , |
||
int | flagsExcluded = 0 |
||
) | [static] |
List all of the interfaces on this machine.
Definition at line 110 of file named_endpoint.cc.
void Datacratic::NamedEndpoint::init | ( | std::shared_ptr< ConfigurationService > | config, |
const std::string & | endpointName | ||
) |
The endpoint exists. Publish that to anyone who may care.
Reimplemented in Datacratic::ZmqNamedClientBus, Datacratic::TcpNamedEndpoint, and Datacratic::HttpNamedEndpoint.
Definition at line 29 of file named_endpoint.cc.
void Datacratic::NamedEndpoint::publishAddress | ( | const std::string & | address, |
const Json::Value & | addressConfig | ||
) |
Publish an address for the endpoint.
Definition at line 38 of file named_endpoint.cc.