C# Class NetworkCommsDotNet.Connections.Connection

Afficher le fichier Open project: MarcFletcher/NetworkComms.Net Class Usage Examples

Protected Properties

Свойство Type Description
asyncListenStarted bool
asyncListenerInRead bool
connectionEstablishWait System.Threading.ManualResetEvent
connectionSetupException bool
connectionSetupExceptionStr string
connectionSetupWait System.Threading.ManualResetEvent
incomingDataListenThread Thread
packetBuilder NetworkCommsDotNet.Tools.PacketBuilder
totalBytesRead int

Méthodes publiques

Méthode Description
EstablishConnection ( ) : void

Establish this connection

ToString ( ) : string

Returns ConnectionInfo.ToString

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

Connection() protected méthode

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
Résultat System

ConnectionHandshake() protected méthode

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
Résultat void

EstablishConnection() public méthode

Establish this connection
public EstablishConnection ( ) : void
Résultat void

EstablishConnectionSpecific() protected abstract méthode

Any connection type specific establish tasks. Should call at least ConnectionHandshake() or TriggerConnectionEstablishDelegates();
protected abstract EstablishConnectionSpecific ( ) : void
Résultat void

IncomingPacketHandleHandOff() protected méthode

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
Résultat void

StartIncomingDataListen() protected abstract méthode

A connection specific method which triggers any requisites for accepting incoming data
protected abstract StartIncomingDataListen ( ) : void
Résultat void

ToString() public méthode

Returns ConnectionInfo.ToString
public ToString ( ) : string
Résultat string

TriggerConnectionEstablishDelegates() protected méthode

Trigger connection establish delegates.
protected TriggerConnectionEstablishDelegates ( ) : void
Résultat void

WaitForConnectionEstablish() protected méthode

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
Résultat bool

Property Details

asyncListenStarted protected_oe property

True if async listen has started
protected bool asyncListenStarted
Résultat bool

asyncListenerInRead protected_oe property

True if the async listen method is in a beginRead
protected bool asyncListenerInRead
Résultat bool

connectionEstablishWait protected_oe property

A manual reset event which can be used to handle connection setup and establish.
protected ManualResetEvent,System.Threading connectionEstablishWait
Résultat System.Threading.ManualResetEvent

connectionSetupException protected_oe property

A boolean used to signal a connection setup exception.
protected bool connectionSetupException
Résultat bool

connectionSetupExceptionStr protected_oe property

If connectionSetupException is true provides additional exception information.
protected string connectionSetupExceptionStr
Résultat string

connectionSetupWait protected_oe property

A manual reset event which can be used to handle connection setup and establish.
protected ManualResetEvent,System.Threading connectionSetupWait
Résultat System.Threading.ManualResetEvent

incomingDataListenThread protected_oe property

The thread listening for incoming data should we be using synchronous methods.
protected Thread incomingDataListenThread
Résultat Thread

packetBuilder protected_oe property

The PacketBuilder for this connection
protected PacketBuilder,NetworkCommsDotNet.Tools packetBuilder
Résultat NetworkCommsDotNet.Tools.PacketBuilder

totalBytesRead protected_oe property

The total bytes read so far within dataBuffer
protected int totalBytesRead
Résultat int