SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWInetPort Class Reference

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

#include <rw/network/RWInetPort.h>

Public Member Functions

 RWInetPort (const char *)
 
 RWInetPort (const RWCString &service)
 
 RWInetPort (int port=0)
 
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 Symbols

(Note that these are not member symbols.)

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() [1/3]

RWInetPort::RWInetPort ( int port = 0)

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

◆ RWInetPort() [2/3]

RWInetPort::RWInetPort ( const RWCString & service)

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

◆ RWInetPort() [3/3]

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

◆ getAliases()

RWTValVector< RWCString > RWInetPort::getAliases ( ) const

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

◆ getName()

RWCString RWInetPort::getName ( ) const

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

◆ getPort()

int RWInetPort::getPort ( ) const

Returns the port number for this port.

◆ id()

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)

◆ operator!=()

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

Returns true if the two port objects are not equal.

◆ operator==()

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

Returns true if the two port objects are equal.

◆ prepare()

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 Symbol Documentation

◆ operator<<()

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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.