libcommonc++  0.7
Network Class Reference

Network-related routines. More...

#include <Network.h++>

Static Public Member Functions

static uint_t getInterfaces (std::vector< NetworkInterface > &list)
 Get a list of all available network interfaces on the host system. More...
 
static uint16_t getPortForService (const String &service, NetProtocol &proto)
 Look up the port number for the given network service. More...
 
static String getServiceForPort (uint16_t port, NetProtocol &proto)
 Look up the network service name for the given port number. More...
 

Friends

class InetAddress
 

Detailed Description

Network-related routines.

Author
Mark Lindner

Member Function Documentation

◆ getInterfaces()

uint_t getInterfaces ( std::vector< NetworkInterface > &  list)
static

Get a list of all available network interfaces on the host system.

Parameters
listThe list in which to store the interface information.
Returns
The number of interfaces retrieved.
Exceptions
SystemExceptionIf an error occurs while retrieving the information.

◆ getPortForService()

uint16_t getPortForService ( const String service,
NetProtocol proto 
)
static

Look up the port number for the given network service.

Parameters
serviceThe name of the service.
protoThe protocol of the service; if ProtoAny, the value is updated to reflect the actual protocol of the service.
Returns
The port number of the service, or 0 if no matching service was found.

◆ getServiceForPort()

String getServiceForPort ( uint16_t  port,
NetProtocol proto 
)
static

Look up the network service name for the given port number.

Parameters
portThe port number.
protoThe protocol of the service; if ProtoAny, the value is updated to reflect the actual protocol of the service.
Returns
The name of the service, or String::null if no matching service was found.

Friends And Related Function Documentation

◆ InetAddress

friend class InetAddress
friend

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