Murl::Net::ISocketAddress Interface Referenceabstract

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::SocketAddressMakeSystemAddress ()=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()

virtual UInt32 Murl::Net::ISocketAddress::GetIpAddress ( ) const
pure virtual

Get the ip-address.

The ip-address format is 0xaabbccdd for "aaa.bbb.ccc.ddd".

Returns
The ip-address.

◆ GetPortNumber()

virtual UInt32 Murl::Net::ISocketAddress::GetPortNumber ( ) const
pure virtual

Get the port number.

Returns
The port number.

◆ GetHostName()

virtual String Murl::Net::ISocketAddress::GetHostName ( ) const
pure virtual

Get the host name.

Returns
The host name.

◆ GetDotNotation()

virtual String Murl::Net::ISocketAddress::GetDotNotation ( ) const
pure virtual

Get the dot notation string of the ip-address.

Returns
The dot notation string of the ip-address.

◆ GetDotPortNotation()

virtual String Murl::Net::ISocketAddress::GetDotPortNotation ( ) const
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()

virtual void Murl::Net::ISocketAddress::SetIpAddress ( UInt32  ipAddress)
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
ipAddressThe ip-address.

◆ SetPortNumber()

virtual void Murl::Net::ISocketAddress::SetPortNumber ( UInt32  portNumber)
pure virtual

Set the port number.

Parameters
portNumberThe port number.

◆ SetAnyAddress()

virtual void Murl::Net::ISocketAddress::SetAnyAddress ( )
pure virtual

Set to the any ip-address (0.0.0.0).

This is the default address for new address objects.

◆ CopyAddress()

virtual void Murl::Net::ISocketAddress::CopyAddress ( ISocketAddressCPtr  address)
pure virtual

Copy the address information.

Parameters
addressThe source address object.

◆ SetResolveHostName()

virtual void Murl::Net::ISocketAddress::SetResolveHostName ( const String hostName = String())
pure virtual

Set the host name for resolving.

An empty string resolves the local host.

Parameters
hostNameThe 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()

virtual System::SocketAddress& Murl::Net::ISocketAddress::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


Copyright © 2011-2024 Spraylight GmbH.