The socket address interface. More...
#include "murl_net_i_socket_address.h"
Inherited by Murl::Net::SocketAddress.
Public Member Functions | |
virtual UInt32 | GetIpAddress () const =0 |
Get the ip-address. More... | |
virtual UInt32 | GetPortNumber () const =0 |
Get the port number. More... | |
virtual String | GetHostName () const =0 |
Get the host name. More... | |
virtual String | GetDotNotation () const =0 |
Get the dot notation string of the ip-address. More... | |
virtual String | GetDotPortNotation () const =0 |
Get the dot notation string of the ip-address and the port. More... | |
virtual void | SetIpAddress (UInt32 ipAddress)=0 |
Set the ip-address. More... | |
virtual void | SetPortNumber (UInt32 portNumber)=0 |
Set the port number. More... | |
virtual void | SetAnyAddress ()=0 |
Set to the any ip-address (0.0.0.0). More... | |
virtual void | SetBroadcastAddress ()=0 |
Set to the broadcast ip-address (255.255.255.255). | |
virtual void | SetLoopbackAddress ()=0 |
Set to the loopback ip-address (127.0.0.1). | |
virtual void | CopyAddress (ISocketAddressCPtr address)=0 |
Copy the address information. More... | |
virtual void | SetResolveHostName (const String &hostName=String())=0 |
Set the host name for resolving. More... | |
virtual System::SocketAddress & | MakeSystemAddress ()=0 |
Get the system socket address object. More... | |
Detailed Description
The socket address interface.
GetIpAddress() and GetPortNumber() returns the values set by SetIpAddress(), SetPortNumber(), SetAnyAddress(), SetBroadcastAddress() and SetLoopbackAddress() only.
The SetResolveHostName() method is safe to be used in the logic code. The ip-address is evaluated later by MakeSystemAddress().
GetHostName() returns the string set by SetResolveHostName() until MakeSystemAddress() evaluates the ip-address, which replaces the host name by the "real" name used for evaluation. The Net::ISocketClient and Net::ISocketServer implementation makes copies of all address objects, so that addresses passed to these classes are not affected by this mechanism.
(!) Do not use MakeSystemAddress() directly in the logic code, this method will wait for network response and is intend for internal socket implementation only.
Member Function Documentation
◆ GetIpAddress()
|
pure virtual |
Get the ip-address.
The ip-address format is 0xaabbccdd for "aaa.bbb.ccc.ddd".
- Returns
- The ip-address.
◆ GetPortNumber()
|
pure virtual |
Get the port number.
- Returns
- The port number.
◆ GetHostName()
|
pure virtual |
Get the host name.
- Returns
- The host name.
◆ GetDotNotation()
|
pure virtual |
Get the dot notation string of the ip-address.
- Returns
- The dot notation string of the ip-address.
◆ GetDotPortNotation()
|
pure virtual |
Get the dot notation string of the ip-address and the port.
- Returns
- The dot notation string of the ip-address and the port.
◆ SetIpAddress()
|
pure virtual |
Set the ip-address.
Additionally the host name is set to the dot-notation of the ip-address. The ip-address format is 0xaabbccdd for "aaa.bbb.ccc.ddd".
- Parameters
-
ipAddress The ip-address.
◆ SetPortNumber()
|
pure virtual |
Set the port number.
- Parameters
-
portNumber The port number.
◆ SetAnyAddress()
|
pure virtual |
Set to the any ip-address (0.0.0.0).
This is the default address for new address objects.
◆ CopyAddress()
|
pure virtual |
Copy the address information.
- Parameters
-
address The source address object.
◆ SetResolveHostName()
|
pure virtual |
Set the host name for resolving.
An empty string resolves the local host.
- Parameters
-
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.
◆ MakeSystemAddress()
|
pure virtual |
Get the system socket address object.
(!) Do not use MakeSystemAddress() directly in the logic code, this method will wait for network response and is intend for internal socket implementation only.
- Returns
- The system socket address object.
The documentation for this interface was generated from the following file:
- murl_net_i_socket_address.h