Monkey Documentation

Class NetworkAddress

This API describes an address as a cohesive component, delegating a discrete set of portable features. More...


Constructors:
  • New ()
  • New ( Host:String, Port:Int )
  • New ( Addr:NetworkAddress )
Properties:

Detailed Discussion

This API describes an address as a cohesive component, delegating a discrete set of portable features. The best parallel to this currently is the SocketAddress type. This type should never be assumed to be compatible with that type, nor should you use that type with this module's API.


Constructor Documentation

Method New ()

This is used internally to create an "empty address".

Method New ( Host:String, Port:Int )

This creates an address representative using Host and Port.

This object may store Host, or any native representation of it.

However, the output from the Host property must be the same as this argument.

The Host argument may contain platform-specific symbols if necessary.

These limits do not apply to Port, which will retain its numeric value internally. (Encoding aside)

Method New ( Addr:NetworkAddress )

This creates an exact replica of Addr with separate storage semantics.

The Host and Port properties will behave the same.


Property Documentation

Method Host : String () Property

This returns the original hostname provided when this object was created.

Following standard construction rules, this does not represent its resolved form.

Method Port : Int () Property

This represents the original port provided when this object was created.

Following standard construction rules, this must represent the original numeric value provided.

Method ToString : String () Property

This provides a string representation of this address.

This will be an implementation-specific hostname, a protocol/implementation dependent separator, and a system-native representation of a port.

Behavior is not guaranteed to be consistent. Consequently, beware of implicit string-conversion.

This type reserves the right to pre-compute the result of this property.