SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Related Functions
RWInetPort Class Reference

Encapsulates an Internet port and its service names. More...

#include <rw/network/RWInetPort.h>

Public Member Functions

 RWInetPort (int port=0)
 
 RWInetPort (const RWCString &service)
 
 RWInetPort (const char *)
 
RWTValVector< RWCStringgetAliases () const
 
RWCString getName () const
 
int getPort () const
 
RWCString id (unsigned level=0) const
 
bool operator!= (const RWInetPort &rhs) const
 
bool operator== (const RWInetPort &rhs) const
 
void prepare () const
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &strm, const RWInetPort &port)
 

Detailed Description

Encapsulates an Internet port and its service names. You can construct an RWInetPort from either an explicit port number or a symbolic service name.

Constructor & Destructor Documentation

RWInetPort::RWInetPort ( int  port = 0)

Builds a port from the port number itself or from a string representing the name of the port.

RWInetPort::RWInetPort ( const RWCString service)

Builds a port from the port number itself or from a string representing the name of the port.

RWInetPort::RWInetPort ( const char *  )

Builds a port from the port number itself or from a string representing the name of the port.

Member Function Documentation

RWTValVector<RWCString> RWInetPort::getAliases ( ) const

Returns the list of aliases for this service name. The RWCString should contain 7-bit US-ASCII data.

RWCString RWInetPort::getName ( ) const

Returns the official service name for this port. The RWCString should contain 7-bit US-ASCII data.

int RWInetPort::getPort ( ) const

Returns the port number for this port.

RWCString RWInetPort::id ( unsigned  level = 0) const

Returns a string describing self. The verbosity of the output is controlled by level where level=0 is the most basic output, and level=9 is the most verbose. The RWCString should contain 7-bit US-ASCII data.

Grammar Definitions

port ::= <port number>
service-name-value ::= <service name>
service-name ::= "(" service-name-value ")"
service-name-list ::= "(" service-name-value ("," service-name-value)* ")"
level Calls prepare() Output Grammar Sample Output for id(level) given RWInetPort(80)
0 port 80
1 port 80
2 port 80
3 X port 80
4 X port (service-name)? 80(http)
5 X port (service-name)? 80(http)
6 X port 80
7 X port (service-name)? 80(http)
8 X port (service-name)? 80(http)
9 X port (service-name-list)? 80(http,www,www-http)
bool RWInetPort::operator!= ( const RWInetPort rhs) const

Returns true if the two port objects are not equal.

bool RWInetPort::operator== ( const RWInetPort rhs) const

Returns true if the two port objects are equal.

void RWInetPort::prepare ( ) const

Ensures that no future operations block. This function calls the service database routines to learn all that can be learned about this port name. It is not necessary to explicitly call prepare() because it is called by other member functions if needed.

Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  strm,
const RWInetPort port 
)
related

Outputs a representation of port on strm. The representation is generated using the member function port.id() with level=0.

Note
This class does not have an extraction (>>) operator.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.