E-MailRelay
Public Member Functions | List of all members
GNet::Listeners Class Reference

Represents a set of listening inputs which can be file-descriptor, interface or network address. More...

#include <glisteners.h>

Public Member Functions

 Listeners (const Interfaces &, const G::StringArray &listener_spec_list, unsigned int port)
 Constructor. More...
 
bool defunct () const
 Returns true if no inputs and static. More...
 
bool idle () const
 Returns true if no inputs but some interfaces might come up. More...
 
bool hasBad () const
 Returns true if one or more inputs are invalid. More...
 
std::string badName () const
 Returns the first invalid input. More...
 
bool hasEmpties () const
 Returns true if some named interfaces have no addresses. More...
 
std::string logEmpties () const
 Returns a log-line snippet for hasEmpties(). More...
 
bool noUpdates () const
 Returns true if some inputs are interfaces but GNet::Interfaces is not active(). More...
 
const std::vector< int > & fds () const
 Exposes the list of fd inputs. More...
 
const std::vector< Address > & fixed () const
 Exposes the list of address inputs. More...
 
const std::vector< Address > & dynamic () const
 Exposes the list of interface addresses. More...
 

Detailed Description

Represents a set of listening inputs which can be file-descriptor, interface or network address.

Definition at line 41 of file glisteners.h.

Constructor & Destructor Documentation

◆ Listeners()

GNet::Listeners::Listeners ( const Interfaces if_,
const G::StringArray listener_spec_list,
unsigned int  port 
)

Constructor.

The specification strings can be like "fd#3" for a file descriptor, "127.0.0.1" for a fixed address, or "ppp0-ipv4" for an interface. If the specification list is empty then the two fixed wildcard addresses are added.

Definition at line 27 of file glisteners.cpp.

Member Function Documentation

◆ badName()

std::string GNet::Listeners::badName ( ) const

Returns the first invalid input.

Definition at line 135 of file glisteners.cpp.

◆ defunct()

bool GNet::Listeners::defunct ( ) const

Returns true if no inputs and static.

Definition at line 106 of file glisteners.cpp.

◆ dynamic()

const std::vector< GNet::Address > & GNet::Listeners::dynamic ( ) const

Exposes the list of interface addresses.

Definition at line 160 of file glisteners.cpp.

◆ fds()

const std::vector< int > & GNet::Listeners::fds ( ) const

Exposes the list of fd inputs.

Definition at line 150 of file glisteners.cpp.

◆ fixed()

const std::vector< GNet::Address > & GNet::Listeners::fixed ( ) const

Exposes the list of address inputs.

Definition at line 155 of file glisteners.cpp.

◆ hasBad()

bool GNet::Listeners::hasBad ( ) const

Returns true if one or more inputs are invalid.

Definition at line 130 of file glisteners.cpp.

◆ hasEmpties()

bool GNet::Listeners::hasEmpties ( ) const

Returns true if some named interfaces have no addresses.

Definition at line 140 of file glisteners.cpp.

◆ idle()

bool GNet::Listeners::idle ( ) const

Returns true if no inputs but some interfaces might come up.

Definition at line 111 of file glisteners.cpp.

◆ logEmpties()

std::string GNet::Listeners::logEmpties ( ) const

Returns a log-line snippet for hasEmpties().

Definition at line 145 of file glisteners.cpp.

◆ noUpdates()

bool GNet::Listeners::noUpdates ( ) const

Returns true if some inputs are interfaces but GNet::Interfaces is not active().

Definition at line 116 of file glisteners.cpp.


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