![]() |
Murl Engine API
Version 2018.3
|
IPV4 socket address class. More...
#include <murl_system_socket_address.h>
IPV4 socket address class.
Platform independent low-level abstraction of the Berkeley socket api. Several methods are blocking calls when waiting for network response.
(!) Do not use this class directly in the logic code. Use Net::ISocketClient and Net::ISocketServer interfaces instead.
Public Member Functions | |
SocketAddress () | |
The default constructor. More... | |
SocketAddress (const SocketAddress &socketAddress) | |
The copy constructor. More... | |
SocketAddress & | operator= (const SocketAddress &socketAddress) |
Assignment operator. More... | |
SocketAddress (const String &hostName) | |
Constructor setting the ip-address by SetHostName(). More... | |
SocketAddress (UInt32 ipAddress) | |
Constructor setting the ip-address by SetIpAddress(). More... | |
virtual | ~SocketAddress () |
The destructor. | |
Bool | SetIpAddress (UInt32 ipAddress) |
Set the ip-address. More... | |
Bool | SetPortNumber (UInt16 portNumber) |
Set the port number. More... | |
Bool | SetToAnyAddress () |
Set to the any ip-address (0.0.0.0). More... | |
Bool | SetToBroadcastAddress () |
Set to the broadcast ip-address (255.255.255.255). More... | |
Bool | SetToLoopBackAddress () |
Set to the loopback ip-address (127.0.0.1). More... | |
String | SetResolveHostName (const String &hostName) |
Set the ip-address by resolving a host name. More... | |
UInt32 | GetIpAddress () const |
Get the ip-address. More... | |
UInt16 | GetPortNumber () const |
Get the port number. More... | |
String | GetDotNotation () const |
Get the dot notation string of the ip-address. More... | |
String | GetDotPortNotation () const |
Get the dot notation string of the ip-address and the port. More... | |
String | GetHostName () const |
Get the host name by resolving the ip-address. More... | |
UInt32 | GetNetworkIpAddress () const |
Get the ip-address in network format. More... | |
void | SetNetworkIpAddress (UInt32 networkIp) |
Set the ip-address in network format. More... | |
UInt16 | GetNetworkPortNumber () const |
Get the port number in network format. More... | |
void | SetNetworkPortNumber (UInt16 networkPort) |
Set the port number in network format. More... | |
Protected Attributes | |
SocketAddressHandle * | mHandle |
The anonymous socket address handle for internal use only. More... | |
Murl::System::SocketAddress::SocketAddress | ( | ) |
The default constructor.
Initializes with any ip-address, see SetToAnyAddress().
Murl::System::SocketAddress::SocketAddress | ( | const SocketAddress & | socketAddress | ) |
The copy constructor.
socketAddress | The SocketAddress object to copy. |
Murl::System::SocketAddress::SocketAddress | ( | const String & | hostName | ) |
Constructor setting the ip-address by SetHostName().
hostName | The host name. |
Murl::System::SocketAddress::SocketAddress | ( | UInt32 | ipAddress | ) |
Constructor setting the ip-address by SetIpAddress().
ipAddress | The ip-address in host format. |
SocketAddress& Murl::System::SocketAddress::operator= | ( | const SocketAddress & | socketAddress | ) |
Assignment operator.
socketAddress | The SocketAddress object to copy. |
Set the ip-address.
The ip-address host format is 0xaabbccdd for "aaa.bbb.ccc.ddd".
ipAddress | The ip-address in host format. |
Set the port number.
portNumber | The port number. |
Bool Murl::System::SocketAddress::SetToAnyAddress | ( | ) |
Set to the any ip-address (0.0.0.0).
Bool Murl::System::SocketAddress::SetToBroadcastAddress | ( | ) |
Set to the broadcast ip-address (255.255.255.255).
Bool Murl::System::SocketAddress::SetToLoopBackAddress | ( | ) |
Set to the loopback ip-address (127.0.0.1).
Set the ip-address by resolving a host name.
An empty string resolves the local host.
hostName | The host name. The host name can be specified by the domain name or the dot notation e.g. "127.0.0.1". If the host name is empty, the local ip-address is used. |
UInt32 Murl::System::SocketAddress::GetIpAddress | ( | ) | const |
Get the ip-address.
The ip-address host format is 0xaabbccdd for "aaa.bbb.ccc.ddd".
UInt16 Murl::System::SocketAddress::GetPortNumber | ( | ) | const |
Get the port number.
String Murl::System::SocketAddress::GetDotNotation | ( | ) | const |
Get the dot notation string of the ip-address.
String Murl::System::SocketAddress::GetDotPortNotation | ( | ) | const |
Get the dot notation string of the ip-address and the port.
String Murl::System::SocketAddress::GetHostName | ( | ) | const |
Get the host name by resolving the ip-address.
UInt32 Murl::System::SocketAddress::GetNetworkIpAddress | ( | ) | const |
Get the ip-address in network format.
void Murl::System::SocketAddress::SetNetworkIpAddress | ( | UInt32 | networkIp | ) |
Set the ip-address in network format.
networkIp | The ip-address in network format. |
UInt16 Murl::System::SocketAddress::GetNetworkPortNumber | ( | ) | const |
Get the port number in network format.
void Murl::System::SocketAddress::SetNetworkPortNumber | ( | UInt16 | networkPort | ) |
Set the port number in network format.
networkPort | The port number in network format. |
|
protected |
The anonymous socket address handle for internal use only.