Skip to main content

Interface IConnectionHandle

Object that can be used as an endPoint or handle for and

Implementation of this should override and so that 2 instance wil be equal if they have the same address internally

When a new connection is received by Peer a copy of this endPoint will be created and given to that connection. On future received the incoming endPoint will be compared to active connections inside a dictionary

Syntax​
public interface IConnectionHandle

Properties​

IsStateful​

Declaration​
bool IsStateful { get; }

SocketLayerConnection​

Used by stateful connections, stores a direct reference to avoid lookup

Declaration​
ISocketLayerConnection SocketLayerConnection { get; set; }

SupportsGracefulDisconnect​

Can gracefulDisconnectReason be used with or should handle Linger and disconnect itself

Declaration​
bool SupportsGracefulDisconnect { get; }

Methods​

Disconnect(String)​

disconnect for stateful connections. Should be made safe to call multiple times

Declaration​
void Disconnect(string gracefulDisconnectReason)
Parameters​
TypeNameDescription
System.StringgracefulDisconnectReason

CreateCopy()​

Used by stateless connection, copy will be stored and used later to sending messages Creates a new instance of with same connection data. this is called when a new connection is created by

Declaration​
IConnectionHandle CreateCopy()
Returns​
TypeDescription
Mirage.SocketLayer.IConnectionHandle

GetHashCode()​

Declaration​
int GetHashCode()
Returns​
TypeDescription
System.Int32

Equals(Object)​

Declaration​
bool Equals(object obj)
Parameters​
TypeNameDescription
System.Objectobj
Returns​
TypeDescription
System.Boolean