Photon Fusion 2.0.3

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
NetAddress Struct Reference

Represents a Network Address, which includes a IP and Port This can contains either a IPv4 or a IPv6 address More...

Inherits IEquatable< NetAddress >.

Classes

class  EqualityComparer
 Provides methods to compare two NetAddress instances for equality. More...
 

Public Member Functions

bool Equals (NetAddress other)
 Determines whether the specified NetAddress instances are equal. More...
 
override bool Equals (object obj)
 Determines whether the specified NetAddress is equal to the current NetAddress. More...
 
override int GetHashCode ()
 Returns a hash code for this instance. More...
 
override string ToString ()
 Provides a string representation of the NetAddress More...
 

Static Public Member Functions

static NetAddress Any (ushort port=0)
 Create a new NetAddress using the "Any" IPv4 Address representation (0.0.0.0) with the Port passed as argument More...
 
static NetAddress AnyIPv6 (ushort port=0)
 Create a new NetAddress using the "Any" IPv6 Address representation (::) with the Port passed as argument More...
 
static NetAddress CreateFromIpPort (string ip, ushort port)
 Create a new NetAddress based on the IP and Port passed as argument More...
 
static NetAddress FromActorId (int actorId)
 Build a new NetAddress based on an ActorId More...
 
static NetAddress LocalhostIPv4 (ushort port=0)
 Create a new NetAddress on the LocalHost address with the desired Port More...
 
static NetAddress LocalhostIPv6 (ushort port=0)
 Create a new NetAddress on the LocalHost IPv6 Address with the desired Port More...
 

Public Attributes

int _actorId
 

Properties

int ActorId [get]
 Retrieves the Remote Actor ID which this NetAddress Represents More...
 
bool HasAddress [get]
 Signal if this NetAddress has a valid IP Address More...
 
bool IsIPv4 [get]
 Signal if the NetAddress represents an IPv4 Address More...
 
bool IsIPv6 [get]
 Signal if the NetAddress represents an IPv6 Address More...
 
bool IsRelayAddr [get]
 Signal if the NetAddress is a Relayed connection More...
 
bool IsValid [get]
 Signal if this NetAddress is not default/empty More...
 

Detailed Description

Represents a Network Address, which includes a IP and Port This can contains either a IPv4 or a IPv6 address

Member Function Documentation

◆ Any()

static NetAddress Any ( ushort  port = 0)
static

Create a new NetAddress using the "Any" IPv4 Address representation (0.0.0.0) with the Port passed as argument

Parameters
portPort used to build the NetAddress
Returns
New NetAddress reference

◆ AnyIPv6()

static NetAddress AnyIPv6 ( ushort  port = 0)
static

Create a new NetAddress using the "Any" IPv6 Address representation (::) with the Port passed as argument

Parameters
portPort used to build the NetAddress
Returns
New NetAddress reference

◆ CreateFromIpPort()

static NetAddress CreateFromIpPort ( string  ip,
ushort  port 
)
static

Create a new NetAddress based on the IP and Port passed as argument

Parameters
ipString representation of an IP, either IPv4 or IPv6
portPort used to build the NetAddress
Returns
New NetAddress reference
Exceptions
ArgumentExceptionIf IP is empty/null or an invalid IP, or port < 0
AssertExceptionIf unable to parse IP

◆ Equals() [1/2]

bool Equals ( NetAddress  other)

Determines whether the specified NetAddress instances are equal.

◆ Equals() [2/2]

override bool Equals ( object  obj)

Determines whether the specified NetAddress is equal to the current NetAddress.

◆ FromActorId()

static NetAddress FromActorId ( int  actorId)
static

Build a new NetAddress based on an ActorId

Parameters
actorIdActorId used to build the NetAddress
Returns
Relay NetAddress that references the ActorId

ActorId must be 0 or greater

◆ GetHashCode()

override int GetHashCode ( )

Returns a hash code for this instance.

◆ LocalhostIPv4()

static NetAddress LocalhostIPv4 ( ushort  port = 0)
static

Create a new NetAddress on the LocalHost address with the desired Port

Parameters
portPort used to build the NetAddress
Returns
New NetAddress reference

◆ LocalhostIPv6()

static NetAddress LocalhostIPv6 ( ushort  port = 0)
static

Create a new NetAddress on the LocalHost IPv6 Address with the desired Port

Parameters
portPort used to build the NetAddress
Returns
New NetAddress reference

◆ ToString()

override string ToString ( )

Provides a string representation of the NetAddress

Property Documentation

◆ ActorId

int ActorId
get

Retrieves the Remote Actor ID which this NetAddress Represents

◆ HasAddress

bool HasAddress
get

Signal if this NetAddress has a valid IP Address

◆ IsIPv4

bool IsIPv4
get

Signal if the NetAddress represents an IPv4 Address

◆ IsIPv6

bool IsIPv6
get

Signal if the NetAddress represents an IPv6 Address

◆ IsRelayAddr

bool IsRelayAddr
get

Signal if the NetAddress is a Relayed connection

◆ IsValid

bool IsValid
get

Signal if this NetAddress is not default/empty