C# Class OpenNos.Core.Networking.Communication.Scs.Client.ScsClientBase

This class provides base functionality for client Classs.
Inheritance: IScsClient
Afficher le fichier Open project: OpenNos/OpenNos

Méthodes publiques

Méthode Description
ClearLowPriorityQueue ( ) : System.Threading.Tasks.Task
Connect ( ) : void

Connects to server.

Disconnect ( ) : void

Disconnects from server. Does nothing if already disconnected.

Dispose ( ) : void

Disposes this object and closes underlying connection.

SendMessage ( IScsMessage message, byte priority ) : void

Sends a message to the server.

Méthodes protégées

Méthode Description
CreateCommunicationChannel ( ) : ICommunicationChannel

This method is implemented by derived Classs to create appropriate communication channel.

Dispose ( bool disposing ) : void
OnConnected ( ) : void

Raises Connected event.

OnDisconnected ( ) : void

Raises Disconnected event.

OnMessageReceived ( IScsMessage message ) : void

Raises MessageReceived event.

OnMessageSent ( IScsMessage message ) : void

Raises MessageSent event.

ScsClientBase ( ) : OpenNos.Core.Networking.Communication.Scs.Communication

Constructor.

Private Methods

Méthode Description
CommunicationChannel_Disconnected ( object sender, EventArgs e ) : void

Handles Disconnected event of _communicationChannel object.

CommunicationChannel_MessageReceived ( object sender, MessageEventArgs e ) : void

Handles MessageReceived event of _communicationChannel object.

CommunicationChannel_MessageSent ( object sender, MessageEventArgs e ) : void

Handles MessageSent event of _communicationChannel object.

PingTimer_Elapsed ( object sender, EventArgs e ) : void

Handles Elapsed event of _pingTimer to send PingMessage messages to server.

Method Details

ClearLowPriorityQueue() public méthode

public ClearLowPriorityQueue ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

Connect() public méthode

Connects to server.
public Connect ( ) : void
Résultat void

CreateCommunicationChannel() protected abstract méthode

This method is implemented by derived Classs to create appropriate communication channel.
protected abstract CreateCommunicationChannel ( ) : ICommunicationChannel
Résultat ICommunicationChannel

Disconnect() public méthode

Disconnects from server. Does nothing if already disconnected.
public Disconnect ( ) : void
Résultat void

Dispose() public méthode

Disposes this object and closes underlying connection.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

OnConnected() protected méthode

Raises Connected event.
protected OnConnected ( ) : void
Résultat void

OnDisconnected() protected méthode

Raises Disconnected event.
protected OnDisconnected ( ) : void
Résultat void

OnMessageReceived() protected méthode

Raises MessageReceived event.
protected OnMessageReceived ( IScsMessage message ) : void
message IScsMessage Received message
Résultat void

OnMessageSent() protected méthode

Raises MessageSent event.
protected OnMessageSent ( IScsMessage message ) : void
message IScsMessage Received message
Résultat void

ScsClientBase() protected méthode

Constructor.
protected ScsClientBase ( ) : OpenNos.Core.Networking.Communication.Scs.Communication
Résultat OpenNos.Core.Networking.Communication.Scs.Communication

SendMessage() public méthode

Sends a message to the server.
/// Throws a CommunicationStateException if client is not connected to the server. ///
public SendMessage ( IScsMessage message, byte priority ) : void
message IScsMessage Message to be sent
priority byte
Résultat void