C# 클래스 Griffin.Net.ChannelTcpListener

Listens on one of the specified protocols
상속: IMessagingListener
파일 보기 프로젝트 열기: jgauffin/Griffin.Framework

공개 메소드들

메소드 설명
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