![]() |
RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
#include <port_range_service.h>
Public Member Functions | |
virtual PortRange | getRange (const std::string &name)=0 |
virtual void | dump (std::ostream &stream=std::cerr) const |
Abstract base class for a service from which you can query a port range by name and receive a PortRange object.
The goal of this class is to split up the port space into chunks, each of which is assigned to a particular kind of service. When dealing with dynamic service creation, this allows us to avoid the situation where a service goes down and a different kind of service starts listening on its port, confusing anything that was connected and didn't know immediately about the change.
Definition at line 77 of file port_range_service.h.
virtual void Datacratic::PortRangeService::dump | ( | std::ostream & | stream = std::cerr | ) | const [inline, virtual] |
Dump the port ranges to the given stream.
Reimplemented in Datacratic::JsonPortRangeService, and Datacratic::DefaultPortRangeService.
Definition at line 89 of file port_range_service.h.
virtual PortRange Datacratic::PortRangeService::getRange | ( | const std::string & | name | ) | [pure virtual] |
Return the range of ports for the given service name, and return the range. If name is not found, then depending upon the implementation either a new range of ports will be defined for that service, or an exception will be thrown.
Implemented in Datacratic::JsonPortRangeService, and Datacratic::DefaultPortRangeService.