Internet Protocol service.
More...
#include <base/net/InetService.h>
Inherits Object.
Internet Protocol service.
This class represents an internet service.
- Version
- 1.0
- Examples
- testsuite/echod.cpp, testsuite/ping.cpp, and testsuite/server.cpp.
◆ InetService() [1/3]
Initializes a service object by specified service name and protocol.
- Parameters
-
name | Specifies the name of the service. |
protocol | Specifies the name of the protocol. Default is "tcp". |
◆ InetService() [2/3]
InetService::InetService |
( |
unsigned short |
port, |
|
|
const String & |
protocol = Literal("tcp") |
|
) |
| |
|
explicit |
Initializes a service object by specified port number and protocol.
- Parameters
-
port | The port number. |
protocol | Specifies the name of the protocol. Default is "tcp". |
◆ InetService() [3/3]
◆ getByName()
static unsigned short InetService::getByName |
( |
const String & |
name, |
|
|
const String & |
protocol |
|
) |
| |
|
staticnoexcept |
Returns the port number of the service given by the service name and protocol.
- Parameters
-
name | Specifies the name of the service. |
protocol | Specifies the name of the protocol. Default is "tcp". |
- Returns
- 0 if the service was not found.
◆ getByPort()
static String InetService::getByPort |
( |
unsigned short |
port, |
|
|
const String & |
protocol |
|
) |
| |
|
staticnoexcept |
Returns the name of the service given by the specified port and protocol.
- Parameters
-
port | Specifies the port number. |
protocol | Specifies the name of the protocol. Default is "tcp". |
- Returns
- Empty string if service was not found.
◆ getName()
const String& InetService::getName |
( |
| ) |
const |
|
noexcept |
◆ getPort()
unsigned short InetService::getPort |
( |
| ) |
const |
|
noexcept |
◆ getProtocol()
const String& InetService::getProtocol |
( |
| ) |
const |
|
noexcept |
◆ operator=()