C# Class OpenNos.Core.Networking.Communication.Scs.Communication.Channels.Tcp.TcpCommunicationChannel

This class is used to communicate with a remote application over TCP/IP protocol.
Inheritance: CommunicationChannelBase
Exibir arquivo Open project: OpenNos/OpenNos

Public Methods

Method Description
ClearLowPriorityQueue ( ) : Task
Disconnect ( ) : void

Disconnects from remote application and closes channel.

Dispose ( ) : void

Calls Disconnect method.

SendInterval ( ) : void
StartSending ( System.Action action, System.TimeSpan period, CancellationToken _sendCancellationToken ) : Task
TcpCommunicationChannel ( Socket clientSocket ) : OpenNos.Core.Networking.Communication.Scs.Communication.EndPoints

Creates a new TcpCommunicationChannel object.

Protected Methods

Method Description
Dispose ( bool disposing ) : void
SendMessagepublic ( IScsMessage message, byte priority ) : void

Sends a message to the remote application.

Startpublic ( ) : void

Starts the thread to receive messages from socket.

Private Methods

Method Description
ReceiveCallback ( IAsyncResult ar ) : void

This method is used as callback method in _clientSocket's BeginReceive method. It reveives bytes from socker.

SendByPriority ( ConcurrentQueue buffer ) : void
SendCallback ( IAsyncResult ar ) : void

Method Details

ClearLowPriorityQueue() public method

public ClearLowPriorityQueue ( ) : Task
return Task

Disconnect() public method

Disconnects from remote application and closes channel.
public Disconnect ( ) : void
return void

Dispose() public method

Calls Disconnect method.
public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

SendInterval() public method

public SendInterval ( ) : void
return void

SendMessagepublic() protected method

Sends a message to the remote application.
protected SendMessagepublic ( IScsMessage message, byte priority ) : void
message IScsMessage Message to be sent
priority byte
return void

StartSending() public static method

public static StartSending ( System.Action action, System.TimeSpan period, CancellationToken _sendCancellationToken ) : Task
action System.Action
period System.TimeSpan
_sendCancellationToken System.Threading.CancellationToken
return Task

Startpublic() protected method

Starts the thread to receive messages from socket.
protected Startpublic ( ) : void
return void

TcpCommunicationChannel() public method

Creates a new TcpCommunicationChannel object.
public TcpCommunicationChannel ( Socket clientSocket ) : OpenNos.Core.Networking.Communication.Scs.Communication.EndPoints
clientSocket Socket /// A connected Socket object that is used to communicate over network ///
return OpenNos.Core.Networking.Communication.Scs.Communication.EndPoints