Encapsulates an Internet port and its service names.
More...
#include <rw/network/RWInetPort.h>
Encapsulates an Internet port and its service names. You can construct an RWInetPort from either an explicit port number or a symbolic service name.
◆ 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.
◆ getAliases()
Returns the list of aliases for this service name. The RWCString should contain 7-bit US-ASCII data.
◆ getName()
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) |
◆ 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.
◆ operator!=()
◆ 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.
◆ operator==()
Returns true
if lhs represents the same port as rhs.