C# Class OpenNos.Core.Networking.Communication.Scs.Server.ScsServerClient

This class represents a client in server side.
Inheritance: IScsServerClient
Mostra file Open project: OpenNos/OpenNos

Public Methods

Method Description
ClearLowPriorityQueue ( ) : System.Threading.Tasks.Task
Disconnect ( ) : void

Disconnects from client and closes underlying communication channel.

ScsServerClient ( ICommunicationChannel communicationChannel ) : OpenNos.Core.Networking.Communication.Scs.Communication

Creates a new ScsClient object.

SendMessage ( IScsMessage message, byte priority ) : void

Sends a message to the client.

Protected Methods

Method Description
OnMessageSent ( IScsMessage message ) : void

Raises MessageSent event.

Private Methods

Method 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.

OnDisconnected ( ) : void

Raises Disconnected event.

OnMessageReceived ( IScsMessage message ) : void

Raises MessageReceived event.

Method Details

ClearLowPriorityQueue() public method

public ClearLowPriorityQueue ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Disconnect() public method

Disconnects from client and closes underlying communication channel.
public Disconnect ( ) : void
return void

OnMessageSent() protected method

Raises MessageSent event.
protected OnMessageSent ( IScsMessage message ) : void
message IScsMessage Received message
return void

ScsServerClient() public method

Creates a new ScsClient object.
public ScsServerClient ( ICommunicationChannel communicationChannel ) : OpenNos.Core.Networking.Communication.Scs.Communication
communicationChannel ICommunicationChannel /// The communication channel that is used by client to send and receive messages ///
return OpenNos.Core.Networking.Communication.Scs.Communication

SendMessage() public method

Sends a message to the client.
public SendMessage ( IScsMessage message, byte priority ) : void
message IScsMessage Message to be sent
priority byte
return void