Murl Engine Lua Addon API  Version 1.0 beta
Murl.Net.ISocketAddress

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.


Table members

Methods


GetIpAddress()

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

Integer GetIpAddress()

Returns
Integer The ip-address.

GetPortNumber()

Get the port number.

Integer GetPortNumber()

Returns
Integer The port number.

GetHostName()

Get the host name.

String GetHostName()

Returns
String The host name.

GetDotNotation()

Get the dot notation string of the ip-address.

String GetDotNotation()

Returns
String The dot notation string of the ip-address.

GetDotPortNotation()

Get the dot notation string of the ip-address and the port.

String GetDotPortNotation()

Returns
String The dot notation string of the ip-address and the port.

SetIpAddress(ipAddress)

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".

SetIpAddress(Integer ipAddress)

Parameters
ipAddressThe ip-address.

SetPortNumber(portNumber)

Set the port number.

SetPortNumber(Integer portNumber)

Parameters
portNumberThe port number.

SetAnyAddress()

Set to the any ip-address (0.0.0.0). This is the default address for new address objects.

SetAnyAddress()


SetBroadcastAddress()

Set to the broadcast ip-address (255.255.255.255).

SetBroadcastAddress()


SetLoopbackAddress()

Set to the loopback ip-address (127.0.0.1).

SetLoopbackAddress()


CopyAddress(address)

Copy the address information.

CopyAddress(Murl.SharedPointer.NetISocketAddressConst address)

Parameters
addressThe source address object.

SetResolveHostName(hostName)

Set the host name for resolving. An empty string resolves the local host.

SetResolveHostName(String hostName)

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.


Metamethods


The tostring operator

Converts the object content to a string in a reasonable format.

Returns
GetDotPortNotation()