C# Класс Griffin.Net.ChannelTcpListener

Listens on one of the specified protocols
Наследование: IMessagingListener
Показать файл Открыть проект

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

Метод Описание
ChannelTcpListener ( ) : System

ChannelTcpListener ( Griffin.Net.ChannelTcpListenerConfiguration configuration ) : System

Start ( IPAddress address, int port ) : void

Start this listener.

This also pre-configures 20 channels that can be used and reused during the lifetime of this listener.

Stop ( ) : void

Stop the listener.

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

Метод Описание
Configure ( Griffin.Net.ChannelTcpListenerConfiguration configuration ) : void

To allow the sub classes to configure this class in their constructors.

OnClientConnected ( ITcpChannel channel ) : Griffin.Net.Protocols.ClientConnectedEventArgs

A client has connected (nothing has been sent or received yet)

OnClientDisconnected ( ITcpChannel channel, Exception exception ) : void

A client has disconnected

OnListenerError ( Exception ex ) : void

Invoke when the listener itself fails

OnMessage ( ITcpChannel source, object msg ) : void

Receive a new message from the specified client

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

Метод Описание
OnAcceptSocket ( IAsyncResult ar ) : void
OnChannelDisconnect ( ITcpChannel source, Exception exception ) : void

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

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

public ChannelTcpListener ( ) : System
Результат System

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

public ChannelTcpListener ( Griffin.Net.ChannelTcpListenerConfiguration configuration ) : System
configuration Griffin.Net.ChannelTcpListenerConfiguration
Результат System

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

To allow the sub classes to configure this class in their constructors.
protected Configure ( Griffin.Net.ChannelTcpListenerConfiguration configuration ) : void
configuration Griffin.Net.ChannelTcpListenerConfiguration
Результат void

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

A client has connected (nothing has been sent or received yet)
protected OnClientConnected ( ITcpChannel channel ) : Griffin.Net.Protocols.ClientConnectedEventArgs
channel ITcpChannel Channel which we created for the remote socket.
Результат Griffin.Net.Protocols.ClientConnectedEventArgs

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

A client has disconnected
protected OnClientDisconnected ( ITcpChannel channel, Exception exception ) : void
channel ITcpChannel Channel representing the client that disconnected
exception System.Exception /// Exception which was used to detect disconnect (SocketException with status /// Success is created for graceful disconnects) ///
Результат void

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

Invoke when the listener itself fails
protected OnListenerError ( Exception ex ) : void
ex System.Exception Caught exception
Результат void

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

Receive a new message from the specified client
protected OnMessage ( ITcpChannel source, object msg ) : void
source ITcpChannel Channel for the client
msg object Message (as decoded by the specified ).
Результат void

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

Start this listener.
This also pre-configures 20 channels that can be used and reused during the lifetime of this listener.
public Start ( IPAddress address, int port ) : void
address System.Net.IPAddress Address to accept connections on
port int Port to use. Set to 0 to let the OS decide which port to use.
Результат void

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

Stop the listener.
public Stop ( ) : void
Результат void