C# Класс NetworkCommsDotNet.Connections.Connection

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
asyncListenStarted bool
asyncListenerInRead bool
connectionEstablishWait System.Threading.ManualResetEvent
connectionSetupException bool
connectionSetupExceptionStr string
connectionSetupWait System.Threading.ManualResetEvent
incomingDataListenThread Thread
packetBuilder NetworkCommsDotNet.Tools.PacketBuilder
totalBytesRead int

Открытые методы

Метод Описание
EstablishConnection ( ) : void

Establish this connection

ToString ( ) : string

Returns ConnectionInfo.ToString

Защищенные методы

Метод Описание
Connection ( ConnectionInfo connectionInfo, SendReceiveOptions defaultSendReceiveOptions ) : System

Create a new connection object

ConnectionHandshake ( ) : void

Performs a connection handshake with the remote end of the connection. Exchanges network identifier and any listener whose IPAddress matches the connection localEndPoint IPAddress.

EstablishConnectionSpecific ( ) : void

Any connection type specific establish tasks. Should call at least ConnectionHandshake() or TriggerConnectionEstablishDelegates();

IncomingPacketHandleHandOff ( PacketBuilder packetBuilder ) : void

Attempts to use the data provided in packetBuilder to recreate something useful. If we don't have enough data yet that value is set in packetBuilder.

StartIncomingDataListen ( ) : void

A connection specific method which triggers any requisites for accepting incoming data

TriggerConnectionEstablishDelegates ( ) : void

Trigger connection establish delegates.

WaitForConnectionEstablish ( int waitTimeoutMS ) : bool

Return true if the connection is established within the provided timeout, otherwise false

Приватные методы

Метод Описание
CheckSumFailResendHandler ( MemoryStream packetDataSection ) : void

Handle an incoming CheckSumFailResend packet type

ConnectionSetupHandler ( MemoryStream packetDataSection ) : void

Handle an incoming ConnectionSetup packet type

ConnectionSetupHandlerFinal ( ConnectionInfo remoteConnectionInfo, bool &possibleClashWithExistingConnection, Connection &existingConnection ) : bool

Attempts to complete the connection establish with a minimum of locking to avoid possible deadlocking

Описание методов

Connection() защищенный Метод

Create a new connection object
protected Connection ( ConnectionInfo connectionInfo, SendReceiveOptions defaultSendReceiveOptions ) : System
connectionInfo ConnectionInfo ConnectionInfo corresponding to the new connection
defaultSendReceiveOptions SendReceiveOptions The SendReceiveOptions which should be used as connection defaults
Результат System

ConnectionHandshake() защищенный Метод

Performs a connection handshake with the remote end of the connection. Exchanges network identifier and any listener whose IPAddress matches the connection localEndPoint IPAddress.
protected ConnectionHandshake ( ) : void
Результат void

EstablishConnection() публичный Метод

Establish this connection
public EstablishConnection ( ) : void
Результат void

EstablishConnectionSpecific() защищенный абстрактный Метод

Any connection type specific establish tasks. Should call at least ConnectionHandshake() or TriggerConnectionEstablishDelegates();
protected abstract EstablishConnectionSpecific ( ) : void
Результат void

IncomingPacketHandleHandOff() защищенный Метод

Attempts to use the data provided in packetBuilder to recreate something useful. If we don't have enough data yet that value is set in packetBuilder.
protected IncomingPacketHandleHandOff ( PacketBuilder packetBuilder ) : void
packetBuilder NetworkCommsDotNet.Tools.PacketBuilder The containing incoming cached data
Результат void

StartIncomingDataListen() защищенный абстрактный Метод

A connection specific method which triggers any requisites for accepting incoming data
protected abstract StartIncomingDataListen ( ) : void
Результат void

ToString() публичный Метод

Returns ConnectionInfo.ToString
public ToString ( ) : string
Результат string

TriggerConnectionEstablishDelegates() защищенный Метод

Trigger connection establish delegates.
protected TriggerConnectionEstablishDelegates ( ) : void
Результат void

WaitForConnectionEstablish() защищенный Метод

Return true if the connection is established within the provided timeout, otherwise false
protected WaitForConnectionEstablish ( int waitTimeoutMS ) : bool
waitTimeoutMS int Wait time in milliseconds before returning
Результат bool

Описание свойств

asyncListenStarted защищенное свойство

True if async listen has started
protected bool asyncListenStarted
Результат bool

asyncListenerInRead защищенное свойство

True if the async listen method is in a beginRead
protected bool asyncListenerInRead
Результат bool

connectionEstablishWait защищенное свойство

A manual reset event which can be used to handle connection setup and establish.
protected ManualResetEvent,System.Threading connectionEstablishWait
Результат System.Threading.ManualResetEvent

connectionSetupException защищенное свойство

A boolean used to signal a connection setup exception.
protected bool connectionSetupException
Результат bool

connectionSetupExceptionStr защищенное свойство

If connectionSetupException is true provides additional exception information.
protected string connectionSetupExceptionStr
Результат string

connectionSetupWait защищенное свойство

A manual reset event which can be used to handle connection setup and establish.
protected ManualResetEvent,System.Threading connectionSetupWait
Результат System.Threading.ManualResetEvent

incomingDataListenThread защищенное свойство

The thread listening for incoming data should we be using synchronous methods.
protected Thread incomingDataListenThread
Результат Thread

packetBuilder защищенное свойство

The PacketBuilder for this connection
protected PacketBuilder,NetworkCommsDotNet.Tools packetBuilder
Результат NetworkCommsDotNet.Tools.PacketBuilder

totalBytesRead защищенное свойство

The total bytes read so far within dataBuffer
protected int totalBytesRead
Результат int