Photon Server API Documentation v5.0RC1

Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
Photon.SocketServer.PeerBase Class Referenceabstract

This class is a base class for server connections. The RequestFiber processes all incoming messages. More...

Inheritance diagram for Photon.SocketServer.PeerBase:
Photon.SocketServer.ClientPeer Photon.SocketServer.ServerToServer.S2SPeerBase Photon.Hive.HivePeer Photon.NameServer.ClientPeer Photon.SocketServer.Rpc.Peer Photon.SocketServer.ServerToServer.InboundS2SPeer Photon.SocketServer.ServerToServer.OutboundS2SPeer Photon.LoadBalancing.GameServer.GameClientPeer Photon.LoadBalancing.MasterServer.MasterClientPeer Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer

Classes

struct  EncryptionQueueFailureParams
 

Public Member Functions

void Initialize (InitRequest initRequest)
 
override string ToString ()
 
void Disconnect (int disconnectError=ErrorCodes.Ok)
 Closes the connection. More...
 
void AbortConnection ()
 Forces the connection to close immediately. Should only be used if "Disconnect" does not lead to a clean connection shutdown, e.g. in case of an overloaded connection. More...
 
void Flush ()
 Flushes all pending data to the socket. More...
 
byte[] InitializeEncryption (byte[] otherPartyPublicKey)
 Initializes the peer to receive and send encrypted operations with EncryptionMethod.Sha256Pkcs7. More...
 
byte[] InitializeEncryption (byte[] otherPartyPublicKey, EncryptionMethod mode)
 Initializes the peer to receive and send encrypted operations. More...
 
bool SetupEncryption (EncryptionData encryptionData, byte channelCount, out short errorCode, out string errorMsg)
 
SendResult SendEvent (IEventData eventData, SendParameters sendParameters)
 Sends an IEventData object to the client. More...
 
SendResult SendMessage (object message, SendParameters sendParameters)
 
SendResult SendOperationResponse (OperationResponse operationResponse, SendParameters sendParameters)
 Sends the operation response to the client. More...
 
SendResult SendDisconnectMessage (DisconnectMessage message, SendParameters sendParameters, int disconnectDelay=DefaultDisconnectInterval)
 
void GetStats (out int roundTripTime, out int roundTripTimeVariance, out int numFailures)
 
void SetDebugString (string message)
 
string GetDebugString ()
 
virtual string GetHistograms ()
 
SendResult SendEventAndDisconnect (IEventData eventData, SendParameters sendParameters, int disconnectDelay=DefaultDisconnectInterval, int disconnectCode=ErrorCodes.Ok)
 
SendResult SendMessageAndDisconnect (object message, SendParameters sendParameters, int disconnectDelay=DefaultDisconnectInterval, int disconnectCode=ErrorCodes.Ok)
 
SendResult SendOperationResponseAndDisconnect (OperationResponse operationResponse, SendParameters sendParameters, int disconnectDelay=DefaultDisconnectInterval)
 Sends the operation response to the client. More...
 
void ScheduleDisconnect (int disconnectError, int delay)
 Schedules disconnect for peer. After this call data will be neither accepted from nor sent to client one of use cases is next: send error info and schedule for disconnect. this will give a chance to error information to reach a client More...
 
int GetLastTouch ()
 
void SetPrivateCustomTypeCache (CustomTypeCache cache)
 Sets private custom type cache. It is supposed to be used together with plugins. In other case Protocol.TryRegisterCustomType should be used More...
 
void SetInboundController (InboundController controller)
 
void Dispose ()
 Disposes the peer. More...
 
void Trace (bool enabled, object tag)
 

Public Attributes

bool Connected => this.ConnectionState == ConnectionState.Connected || this.connectionState == ConnectionState.ScheduledForDisconnect
 Gets a value indicating whether this PeerBase instance is connected. More...
 
int ConnectionId => this.UnmanagedPeer.GetConnectionID()
 Gets the connection id. More...
 
bool IsConnectionSecure => this.datagramEncryptionUsed || this.NetworkProtocol == NetworkProtocolType.SecureWebSocket
 
bool Disposed => this.ConnectionState == ConnectionState.Disposed
 Gets a value indicating whether the peer was disposed. More...
 
bool ScheduledForDisconnect => this.connectionState == ConnectionState.ScheduledForDisconnect
 
IPAddress LocalIPAddress => string.IsNullOrEmpty(this.LocalIP) ? IPAddress.None : IPAddress.Parse(this.LocalIP)
 Gets the IP Address the client connects to. More...
 
IPAddress RemoteIPAddress => string.IsNullOrEmpty(this.RemoteIP) ? IPAddress.None : IPAddress.Parse(this.RemoteIP)
 Gets the client's remote IP address. More...
 
IFiber RequestFiber => this.requestFiber
 Gets fiber for incoming messages. More...
 
bool LocalIPAddressIsIPv6 => this.LocalIPAddress.AddressFamily == AddressFamily.InterNetworkV6
 If true connection is using a server IPv6 endpoint. More...
 
bool IsIPv6ToIPv4Bridged => this.SourceUsingIPv6 && this.LocalIPAddress.AddressFamily != AddressFamily.InterNetworkV6
 If true the client is being bridged (DNS64+NAT64), also SourceUsingIPv6. More...
 
ProtocolType ProtocolType => this.protocol.ProtocolType
 

Static Public Attributes

const int DefaultDisconnectInterval = 5_000
 

Protected Member Functions

virtual SendResult SendData (byte[] data, SendParameters sendParameters)
 Sends bytes to the client. More...
 
virtual void OnReceive (byte[] data, SendParameters sendParameters)
 Invoked if incoming data was received for the peer. More...
 
void OnMessageInternal (object message, SendParameters sendParameters)
 
void OnOperationRequestInternal (OperationRequest operationRequest, SendParameters sendParameters)
 
virtual void Dispose (bool disposing)
 Disposes the internal fibers. More...
 
abstract void OnDisconnect (int reasonCode, string reasonDetail)
 The connection was closed. More...
 
virtual void OnSendBufferEmpty ()
 The default behavior of OnSendBufferFull is to disconnect the client. If this behavior is changed (override) the inheritor can pause sending until OnSendBufferEmpty is called. More...
 
virtual void OnDeserializationError (byte[] data, RtsMessageType msgType, string debugMessage, short errorCode=ErrorCodes.UnexpectedData, byte opCode=0, Exception exception=null)
 This method is called if incoming data has an unexpected format. Per default this method disconnects the client. Override to change this behavior. More...
 
OperationRequest ParseOperationRequest (byte[] data, SendParameters sendParameters)
 
OperationRequest ParseInternalOperationRequest (byte[] data, SendParameters sendParameters)
 
object ParseMessage (byte[] data, SendParameters sendParameters)
 
byte[] ParseRawMessage (byte[] data, SendParameters sendParameters)
 
void HandleParseError (byte[] data, SendParameters sendParameters, Exception exception, string errorMsg, short errorCode, RtsMessageType msgType, byte operationCode=0)
 
void GetTraceStatus (out int traceOptions, out int enableOptions, out string tag)
 
void DisconnectAfterSend (int disconnectCode, int disconnectDelay, SendResult result)
 
virtual void OnEncryptionQueueOverload (EncryptionQueueFailureParams failureParams)
 

Static Protected Member Functions

static bool NeedSendErrorLog (SendResult sendResult)
 

Protected Attributes

readonly object SyncRoot = new object()
 object for synchronization More...
 
CustomTypeCache privateCustomTypeCache
 
PeerMetaDataContext metaDataContext
 

Static Protected Attributes

static readonly ILogger sendErrorLog = LogManager.GetLogger("Photon.ErrorLog.PeerSendError")
 

Properties

ConnectionState ConnectionState [get, set]
 Gets the ConnectionState for this instance. More...
 
string LocalIP [get]
 Gets the IP the client connects to. More...
 
int LocalPort [get]
 Gets the port the client connects to. More...
 
NetworkProtocolType NetworkProtocol [get]
 Gets the network protocol type used by the peer. More...
 
IRpcProtocol Protocol [get, set]
 Gets the used IRpcProtocol protocol. More...
 
string RemoteIP [get]
 Gets the client's remote IP address. More...
 
int RemotePort [get]
 Gets the port the client connects from. More...
 
int RoundTripTime [get, protected set]
 Gets the last round trip time for this peer. More...
 
int RoundTripTimeVariance [get, protected set]
 Gets the last round trip time variance for this peer. More...
 
int NumFailures [get, protected set]
 
bool SourceUsingIPv6 [get]
 If true the peer is using IPv6 to connect to the server, if the server endpoint used is not IPv6 (LocalIPAddressIsIPv6) it means the client is being bridged (DNS64+NAT64), also IsIPv6ToIPv4Bridged. More...
 
bool ClientUsingDebugLib [get]
 
byte SdkId [get]
 
byte PlatformId [get]
 
Version ClientVersion [get, protected set]
 
DateTime CreationTime = DateTime.Now [get]
 
PeerType PeerType [get]
 Under laying native peer type More...
 
InboundController PrivateInboundController [get]
 
int LastErrorCode [get]
 last error code that we was sent/set though this peer More...
 

Detailed Description

This class is a base class for server connections. The RequestFiber processes all incoming messages.

Member Function Documentation

◆ AbortConnection()

void Photon.SocketServer.PeerBase.AbortConnection ( )
inline

Forces the connection to close immediately. Should only be used if "Disconnect" does not lead to a clean connection shutdown, e.g. in case of an overloaded connection.

◆ Disconnect()

void Photon.SocketServer.PeerBase.Disconnect ( int  disconnectError = ErrorCodes.Ok)
inline

Closes the connection.

◆ DisconnectAfterSend()

void Photon.SocketServer.PeerBase.DisconnectAfterSend ( int  disconnectCode,
int  disconnectDelay,
SendResult  result 
)
inlineprotected

◆ Dispose() [1/2]

void Photon.SocketServer.PeerBase.Dispose ( )
inline

Disposes the peer.

◆ Dispose() [2/2]

virtual void Photon.SocketServer.PeerBase.Dispose ( bool  disposing)
inlineprotectedvirtual

Disposes the internal fibers.

Parameters
disposingTrue if called from Dispose().

Reimplemented in Photon.SocketServer.ServerToServer.S2SPeerBase, and Photon.SocketServer.ServerToServer.OutboundS2SPeer.

◆ Flush()

void Photon.SocketServer.PeerBase.Flush ( )
inline

Flushes all pending data to the socket.

◆ GetDebugString()

string Photon.SocketServer.PeerBase.GetDebugString ( )
inline

◆ GetHistograms()

virtual string Photon.SocketServer.PeerBase.GetHistograms ( )
inlinevirtual

◆ GetLastTouch()

int Photon.SocketServer.PeerBase.GetLastTouch ( )
inline

◆ GetStats()

void Photon.SocketServer.PeerBase.GetStats ( out int  roundTripTime,
out int  roundTripTimeVariance,
out int  numFailures 
)
inline

◆ GetTraceStatus()

void Photon.SocketServer.PeerBase.GetTraceStatus ( out int  traceOptions,
out int  enableOptions,
out string  tag 
)
inlineprotected

◆ HandleParseError()

void Photon.SocketServer.PeerBase.HandleParseError ( byte[]  data,
SendParameters  sendParameters,
Exception  exception,
string  errorMsg,
short  errorCode,
RtsMessageType  msgType,
byte  operationCode = 0 
)
inlineprotected

◆ Initialize()

void Photon.SocketServer.PeerBase.Initialize ( InitRequest  initRequest)
inline

◆ InitializeEncryption() [1/2]

byte [] Photon.SocketServer.PeerBase.InitializeEncryption ( byte[]  otherPartyPublicKey)
inline

Initializes the peer to receive and send encrypted operations with EncryptionMethod.Sha256Pkcs7.

Parameters
otherPartyPublicKeyThe other party public key.
Returns
A byte array containing the public key of the created CryptoProvider instance. The key should be used to initialize cryptography operations on the client site.

◆ InitializeEncryption() [2/2]

byte [] Photon.SocketServer.PeerBase.InitializeEncryption ( byte[]  otherPartyPublicKey,
EncryptionMethod  mode 
)
inline

Initializes the peer to receive and send encrypted operations.

Parameters
otherPartyPublicKeyThe other party public key.
modeSpecifies the EncryptionMethod.
Returns
A byte array containing the public key of the created CryptoProvider instance. The key should be used to initialize cryptography operations on the client site.

DONOT_USE_NATIVE_CRYPTO_PLUGIN

◆ NeedSendErrorLog()

static bool Photon.SocketServer.PeerBase.NeedSendErrorLog ( SendResult  sendResult)
inlinestaticprotected

◆ OnDeserializationError()

virtual void Photon.SocketServer.PeerBase.OnDeserializationError ( byte[]  data,
RtsMessageType  msgType,
string  debugMessage,
short  errorCode = ErrorCodes.UnexpectedData,
byte  opCode = 0,
Exception  exception = null 
)
inlineprotectedvirtual

This method is called if incoming data has an unexpected format. Per default this method disconnects the client. Override to change this behavior.

Parameters
dataThe received data.
debugMessageA debug message that specifies why the data was unexpected.
errorCode
opCode
exceptionparsing exception

Reimplemented in Photon.Hive.HivePeer.

◆ OnDisconnect()

abstract void Photon.SocketServer.PeerBase.OnDisconnect ( int  reasonCode,
string  reasonDetail 
)
protectedpure virtual

◆ OnEncryptionQueueOverload()

virtual void Photon.SocketServer.PeerBase.OnEncryptionQueueOverload ( EncryptionQueueFailureParams  failureParams)
inlineprotectedvirtual

◆ OnMessageInternal()

void Photon.SocketServer.PeerBase.OnMessageInternal ( object  message,
SendParameters  sendParameters 
)
inlineprotected

◆ OnOperationRequestInternal()

void Photon.SocketServer.PeerBase.OnOperationRequestInternal ( OperationRequest  operationRequest,
SendParameters  sendParameters 
)
inlineprotected

◆ OnReceive()

virtual void Photon.SocketServer.PeerBase.OnReceive ( byte[]  data,
SendParameters  sendParameters 
)
inlineprotectedvirtual

Invoked if incoming data was received for the peer.

Parameters
dataAn array of type Byte containing the received data.
sendParametersA SendParameters instance specifying how the data was send.

Can be overridden in a derived class to implement a custom request handling. The default implementation tries to parse the data as an OperationRequest and invokes the OnOperationRequest method of this instance.

Reimplemented in Photon.SocketServer.ServerToServer.S2SPeerBase.

◆ OnSendBufferEmpty()

virtual void Photon.SocketServer.PeerBase.OnSendBufferEmpty ( )
inlineprotectedvirtual

The default behavior of OnSendBufferFull is to disconnect the client. If this behavior is changed (override) the inheritor can pause sending until OnSendBufferEmpty is called.

Reimplemented in Photon.Hive.HivePeer.

◆ ParseInternalOperationRequest()

OperationRequest Photon.SocketServer.PeerBase.ParseInternalOperationRequest ( byte[]  data,
SendParameters  sendParameters 
)
inlineprotected

◆ ParseMessage()

object Photon.SocketServer.PeerBase.ParseMessage ( byte[]  data,
SendParameters  sendParameters 
)
inlineprotected

◆ ParseOperationRequest()

OperationRequest Photon.SocketServer.PeerBase.ParseOperationRequest ( byte[]  data,
SendParameters  sendParameters 
)
inlineprotected

◆ ParseRawMessage()

byte [] Photon.SocketServer.PeerBase.ParseRawMessage ( byte[]  data,
SendParameters  sendParameters 
)
inlineprotected

◆ ScheduleDisconnect()

void Photon.SocketServer.PeerBase.ScheduleDisconnect ( int  disconnectError,
int  delay 
)
inline

Schedules disconnect for peer. After this call data will be neither accepted from nor sent to client one of use cases is next: send error info and schedule for disconnect. this will give a chance to error information to reach a client

Parameters
disconnectErrorerror code that is reason for disconnect. OperationInvalid for instance
delay

◆ SendData()

virtual SendResult Photon.SocketServer.PeerBase.SendData ( byte[]  data,
SendParameters  sendParameters 
)
inlineprotectedvirtual

Sends bytes to the client.

Parameters
dataThe data.
sendParametersThe send Options.
Returns
SendResult.Disconnected: Not connected anymore. SendResult.SendBufferFull: The send buffer was full. SendResult.Ok: Success.

◆ SendDisconnectMessage()

SendResult Photon.SocketServer.PeerBase.SendDisconnectMessage ( DisconnectMessage  message,
SendParameters  sendParameters,
int  disconnectDelay = DefaultDisconnectInterval 
)
inline

◆ SendEvent()

SendResult Photon.SocketServer.PeerBase.SendEvent ( IEventData  eventData,
SendParameters  sendParameters 
)
inline

Sends an IEventData object to the client.

Parameters
eventDataThe event data.
sendParametersThe send Options.
Returns
SendResult.EncryptionNotSupported: Encryption not initialized. SendResult.Disconnected: Not connected anymore. SendResult.SendBufferFull: The send buffer was full. SendResult.Ok: Success.

◆ SendEventAndDisconnect()

SendResult Photon.SocketServer.PeerBase.SendEventAndDisconnect ( IEventData  eventData,
SendParameters  sendParameters,
int  disconnectDelay = DefaultDisconnectInterval,
int  disconnectCode = ErrorCodes.Ok 
)
inline

◆ SendMessage()

SendResult Photon.SocketServer.PeerBase.SendMessage ( object  message,
SendParameters  sendParameters 
)
inline

◆ SendMessageAndDisconnect()

SendResult Photon.SocketServer.PeerBase.SendMessageAndDisconnect ( object  message,
SendParameters  sendParameters,
int  disconnectDelay = DefaultDisconnectInterval,
int  disconnectCode = ErrorCodes.Ok 
)
inline

◆ SendOperationResponse()

SendResult Photon.SocketServer.PeerBase.SendOperationResponse ( OperationResponse  operationResponse,
SendParameters  sendParameters 
)
inline

Sends the operation response to the client.

Parameters
operationResponseThe operation response.
sendParametersThe send Options.
Returns
SendResult.EncryptionNotSupported: Encryption not initialized. SendResult.Disconnected: Not connected. SendResult.SendBufferFull: The send buffer is full. SendResult.Ok: success.

◆ SendOperationResponseAndDisconnect()

SendResult Photon.SocketServer.PeerBase.SendOperationResponseAndDisconnect ( OperationResponse  operationResponse,
SendParameters  sendParameters,
int  disconnectDelay = DefaultDisconnectInterval 
)
inline

Sends the operation response to the client.

Parameters
operationResponseThe operation response.
sendParametersThe send Options.
disconnectDelay
Returns
SendResult.EncryptionNotSupported: Encryption not initialized. SendResult.Disconnected: Not connected. SendResult.SendBufferFull: The send buffer is full. SendResult.Ok: success.

◆ SetDebugString()

void Photon.SocketServer.PeerBase.SetDebugString ( string  message)
inline

◆ SetInboundController()

void Photon.SocketServer.PeerBase.SetInboundController ( InboundController  controller)
inline

◆ SetPrivateCustomTypeCache()

void Photon.SocketServer.PeerBase.SetPrivateCustomTypeCache ( CustomTypeCache  cache)
inline

Sets private custom type cache. It is supposed to be used together with plugins. In other case Protocol.TryRegisterCustomType should be used

Parameters
cache

◆ SetupEncryption()

bool Photon.SocketServer.PeerBase.SetupEncryption ( EncryptionData  encryptionData,
byte  channelCount,
out short  errorCode,
out string  errorMsg 
)
inline

◆ ToString()

override string Photon.SocketServer.PeerBase.ToString ( )
inline

◆ Trace()

void Photon.SocketServer.PeerBase.Trace ( bool  enabled,
object  tag 
)
inline

Member Data Documentation

◆ Connected

bool Photon.SocketServer.PeerBase.Connected => this.ConnectionState == ConnectionState.Connected || this.connectionState == ConnectionState.ScheduledForDisconnect

Gets a value indicating whether this PeerBase instance is connected.

true if connected; otherwise, false.

◆ ConnectionId

int Photon.SocketServer.PeerBase.ConnectionId => this.UnmanagedPeer.GetConnectionID()

Gets the connection id.

Peers connected to different ports may have similar connection ids.

◆ DefaultDisconnectInterval

const int Photon.SocketServer.PeerBase.DefaultDisconnectInterval = 5_000
static

◆ Disposed

bool Photon.SocketServer.PeerBase.Disposed => this.ConnectionState == ConnectionState.Disposed

Gets a value indicating whether the peer was disposed.

The peer is automatically disposed after OnDisconnect.

◆ IsConnectionSecure

bool Photon.SocketServer.PeerBase.IsConnectionSecure => this.datagramEncryptionUsed || this.NetworkProtocol == NetworkProtocolType.SecureWebSocket

◆ IsIPv6ToIPv4Bridged

bool Photon.SocketServer.PeerBase.IsIPv6ToIPv4Bridged => this.SourceUsingIPv6 && this.LocalIPAddress.AddressFamily != AddressFamily.InterNetworkV6

If true the client is being bridged (DNS64+NAT64), also SourceUsingIPv6.

◆ LocalIPAddress

IPAddress Photon.SocketServer.PeerBase.LocalIPAddress => string.IsNullOrEmpty(this.LocalIP) ? IPAddress.None : IPAddress.Parse(this.LocalIP)

Gets the IP Address the client connects to.

◆ LocalIPAddressIsIPv6

bool Photon.SocketServer.PeerBase.LocalIPAddressIsIPv6 => this.LocalIPAddress.AddressFamily == AddressFamily.InterNetworkV6

If true connection is using a server IPv6 endpoint.

◆ metaDataContext

PeerMetaDataContext Photon.SocketServer.PeerBase.metaDataContext
protected

◆ privateCustomTypeCache

CustomTypeCache Photon.SocketServer.PeerBase.privateCustomTypeCache
protected

◆ ProtocolType

ProtocolType Photon.SocketServer.PeerBase.ProtocolType => this.protocol.ProtocolType

◆ RemoteIPAddress

IPAddress Photon.SocketServer.PeerBase.RemoteIPAddress => string.IsNullOrEmpty(this.RemoteIP) ? IPAddress.None : IPAddress.Parse(this.RemoteIP)

Gets the client's remote IP address.

◆ RequestFiber

IFiber Photon.SocketServer.PeerBase.RequestFiber => this.requestFiber

Gets fiber for incoming messages.

◆ ScheduledForDisconnect

bool Photon.SocketServer.PeerBase.ScheduledForDisconnect => this.connectionState == ConnectionState.ScheduledForDisconnect

◆ sendErrorLog

readonly ILogger Photon.SocketServer.PeerBase.sendErrorLog = LogManager.GetLogger("Photon.ErrorLog.PeerSendError")
staticprotected

◆ SyncRoot

readonly object Photon.SocketServer.PeerBase.SyncRoot = new object()
protected

object for synchronization

Property Documentation

◆ ClientUsingDebugLib

bool Photon.SocketServer.PeerBase.ClientUsingDebugLib
get

◆ ClientVersion

Version Photon.SocketServer.PeerBase.ClientVersion
getprotected set

◆ ConnectionState

ConnectionState Photon.SocketServer.PeerBase.ConnectionState
getset

Gets the ConnectionState for this instance.

◆ CreationTime

DateTime Photon.SocketServer.PeerBase.CreationTime = DateTime.Now
get

◆ LastErrorCode

int Photon.SocketServer.PeerBase.LastErrorCode
get

last error code that we was sent/set though this peer

◆ LocalIP

string Photon.SocketServer.PeerBase.LocalIP
get

Gets the IP the client connects to.

◆ LocalPort

int Photon.SocketServer.PeerBase.LocalPort
get

Gets the port the client connects to.

◆ NetworkProtocol

NetworkProtocolType Photon.SocketServer.PeerBase.NetworkProtocol
get

Gets the network protocol type used by the peer.

The network protocol type.

◆ NumFailures

int Photon.SocketServer.PeerBase.NumFailures
getprotected set

◆ PeerType

PeerType Photon.SocketServer.PeerBase.PeerType
get

Under laying native peer type

◆ PlatformId

byte Photon.SocketServer.PeerBase.PlatformId
get

◆ PrivateInboundController

InboundController Photon.SocketServer.PeerBase.PrivateInboundController
get

◆ Protocol

IRpcProtocol Photon.SocketServer.PeerBase.Protocol
getset

Gets the used IRpcProtocol protocol.

◆ RemoteIP

string Photon.SocketServer.PeerBase.RemoteIP
get

Gets the client's remote IP address.

◆ RemotePort

int Photon.SocketServer.PeerBase.RemotePort
get

Gets the port the client connects from.

◆ RoundTripTime

int Photon.SocketServer.PeerBase.RoundTripTime
getprotected set

Gets the last round trip time for this peer.

This property is updated after each incoming request from the client. Only set for ENet / UDP peers, not for TCP peers.

◆ RoundTripTimeVariance

int Photon.SocketServer.PeerBase.RoundTripTimeVariance
getprotected set

Gets the last round trip time variance for this peer.

This property is updated after each incoming request from the client. Only set for ENet / UDP peers, not for TCP peers.

◆ SdkId

byte Photon.SocketServer.PeerBase.SdkId
get

◆ SourceUsingIPv6

bool Photon.SocketServer.PeerBase.SourceUsingIPv6
get

If true the peer is using IPv6 to connect to the server, if the server endpoint used is not IPv6 (LocalIPAddressIsIPv6) it means the client is being bridged (DNS64+NAT64), also IsIPv6ToIPv4Bridged.