Photon Fusion 1.1.12

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

Public Member Functions

bool Equals (NetAddress other)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 

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

◆ 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 greated

◆ 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

Property Documentation

◆ ActorId

int ActorId
get

Retrieves the Remote Actor ID which this NetAddress Represents

◆ 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