OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::PortManager Class Reference

The PortManager may be used to determine available ports and store the information about ports occupied by the PortManager. More...

#include "PortManager.h"

Public Member Functions

void addPortRange (const PortRange &_range)
 Adds the port range to be used to determine available ports.
 
void addPortRange (ot::port_t _from, ot::port_t _to)
 Adds the port range to be used to determine available ports.
 
void setPortNotInUse (ot::port_t _portNumber)
 Set the specified port as "not in use".
 
bool isPortInUse (ot::port_t _portNumber)
 Returns true if the provided port is occupied.
 
ot::port_t determineAndBlockAvailablePort (void)
 Determines the next available port and stores its information. The PortManager will determine the next available port. If a port was found, the port number will be saved as a "port in use".
 

Static Public Member Functions

static PortManagerinstance (void)
 Returns the global instance.
 

Private Member Functions

virtual ~PortManager ()
 Private destructor.
 

Detailed Description

The PortManager may be used to determine available ports and store the information about ports occupied by the PortManager.

Member Function Documentation

◆ addPortRange() [1/2]

void PortManager::addPortRange ( const PortRange & _range)

Adds the port range to be used to determine available ports.

Parameters
_rangeRange to add.

◆ addPortRange() [2/2]

void PortManager::addPortRange ( ot::port_t _from,
ot::port_t _to )

Adds the port range to be used to determine available ports.

Note
Note that the port number must not exceed 49,151.
Parameters
_fromStarting port.
_toFinal port.

◆ determineAndBlockAvailablePort()

ot::port_t PortManager::determineAndBlockAvailablePort ( void )

Determines the next available port and stores its information. The PortManager will determine the next available port. If a port was found, the port number will be saved as a "port in use".

◆ instance()

ot::PortManager & PortManager::instance ( void )
static

Returns the global instance.

◆ isPortInUse()

bool PortManager::isPortInUse ( ot::port_t _portNumber)

Returns true if the provided port is occupied.

◆ setPortNotInUse()

void PortManager::setPortNotInUse ( ot::port_t _portNumber)

Set the specified port as "not in use".

Parameters
_portNumberPort to unset.

◆ ~PortManager()

PortManager::~PortManager ( )
privatevirtual

Private destructor.


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