KS.Reactor.ksAddress Struct Reference

Holds host and port More...

Public Member Functions

 ksAddress (string host, ushort port)
 Constructor More...
 
 ksAddress (ksJSON json)
 Constructs an address from a ksJSON object. More...
 
ksJSON ToJSON ()
 Converts the address to a ksJSON object. More...
 
void Serialize (ksOutputBuffer output)
 Serializes the address to an output buffer. More...
 
void Deserialize (ksInputBuffer input)
 Deserializes the address from an input buffer. More...
 
override string ToString ()
 Returns the string Host:Port More...
 
override bool Equals (object obj)
 Checks if this address is equal to an object. More...
 
override int GetHashCode ()
 Gets the hash code for the address. More...
 

Static Public Member Functions

static bool operator== (ksAddress lhs, ksAddress rhs)
 Checks if two addresses are the same. More...
 
static bool operator!= (ksAddress lhs, ksAddress rhs)
 Checks if two addresses are not the same. More...
 

Public Attributes

string Host
 Host More...
 
ushort Port
 Port More...
 

Properties

bool IsValid [get]
 Is the address valid? To be valid, Host must be non-empty and Port must be non-zero. More...
 

Detailed Description

Holds host and port

Constructor & Destructor Documentation

◆ ksAddress() [1/2]

KS.Reactor.ksAddress.ksAddress ( string  host,
ushort  port 
)

Constructor

Parameters
hostHost
portPort

◆ ksAddress() [2/2]

KS.Reactor.ksAddress.ksAddress ( ksJSON  json)

Constructs an address from a ksJSON object.

Parameters
jsonJson object containing host and port fields.

Member Function Documentation

◆ Deserialize()

void KS.Reactor.ksAddress.Deserialize ( ksInputBuffer  input)

Deserializes the address from an input buffer.

Parameters
inputInput to deserialize from.

◆ Equals()

override bool KS.Reactor.ksAddress.Equals ( object  obj)

Checks if this address is equal to an object.

Parameters
obj
Returns
True if the object is an equivalent address.

◆ GetHashCode()

override int KS.Reactor.ksAddress.GetHashCode ( )

Gets the hash code for the address.

Returns
Hash code

◆ operator!=()

static bool KS.Reactor.ksAddress.operator!= ( ksAddress  lhs,
ksAddress  rhs 
)
static

Checks if two addresses are not the same.

Parameters
lhs
rhs
Returns
True if the addresses are not the same.

◆ operator==()

static bool KS.Reactor.ksAddress.operator== ( ksAddress  lhs,
ksAddress  rhs 
)
static

Checks if two addresses are the same.

Parameters
lhs
rhs
Returns
True if the addresses are the same.

◆ Serialize()

void KS.Reactor.ksAddress.Serialize ( ksOutputBuffer  output)

Serializes the address to an output buffer.

Parameters
outputOutput to serialize to.

◆ ToJSON()

ksJSON KS.Reactor.ksAddress.ToJSON ( )

Converts the address to a ksJSON object.

Returns
Json object containing host and port fields.

◆ ToString()

override string KS.Reactor.ksAddress.ToString ( )

Returns the string Host:Port

Returns
Host:Port

Member Data Documentation

◆ Host

string KS.Reactor.ksAddress.Host

Host

◆ Port

ushort KS.Reactor.ksAddress.Port

Port

Property Documentation

◆ IsValid

bool KS.Reactor.ksAddress.IsValid
get

Is the address valid? To be valid, Host must be non-empty and Port must be non-zero.