C# 클래스 FastNetwork.SocketServer

socket 服务器
상속: BaseSocketServer
파일 보기 프로젝트 열기: zhujunxxxxx/FastNetwork 1 사용 예제들

공개 메소드들

메소드 설명
AddListener ( string name, IPEndPoint endPoint ) : ISocketListener

add socket listener

SocketServer ( IServerHandler handler, IEncoder encoder, IDecoder decoder ) : System

使用默认配置参数的构造函数

SocketServer ( IServerHandler handler, Protocol protocol, int socketBufferSize, int messageBufferSize, int maxMessageSize, int maxConnections ) : System

new

Start ( ) : void

start

Stop ( ) : void

stop

보호된 메소드들

메소드 설명
OnConnected ( IConnection connection ) : void

OnConnected

OnDisconnected ( IConnection connection, Exception ex ) : void

OnDisconnected

OnError ( IConnection connection, Exception ex ) : void

onError

OnMessageReceived ( IConnection connection, MessageReceivedEventArgs e ) : void

OnMessageReceived

OnSendCallback ( IConnection connection, SendCallbackEventArgs e ) : void

send callback

OnStartSending ( IConnection connection, Packet packet ) : void

start sending

비공개 메소드들

메소드 설명
listener_Accepted ( ISocketListener listener, IConnection connection ) : void

socket accepted handler

메소드 상세

AddListener() 공개 메소드

add socket listener
public AddListener ( string name, IPEndPoint endPoint ) : ISocketListener
name string
endPoint System.Net.IPEndPoint
리턴 ISocketListener

OnConnected() 보호된 메소드

OnConnected
protected OnConnected ( IConnection connection ) : void
connection IConnection
리턴 void

OnDisconnected() 보호된 메소드

OnDisconnected
protected OnDisconnected ( IConnection connection, Exception ex ) : void
connection IConnection
ex System.Exception
리턴 void

OnError() 보호된 메소드

onError
protected OnError ( IConnection connection, Exception ex ) : void
connection IConnection
ex System.Exception
리턴 void

OnMessageReceived() 보호된 메소드

OnMessageReceived
protected OnMessageReceived ( IConnection connection, MessageReceivedEventArgs e ) : void
connection IConnection
e FastNetwork.Event.MessageReceivedEventArgs
리턴 void

OnSendCallback() 보호된 메소드

send callback
protected OnSendCallback ( IConnection connection, SendCallbackEventArgs e ) : void
connection IConnection
e SendCallbackEventArgs
리턴 void

OnStartSending() 보호된 메소드

start sending
protected OnStartSending ( IConnection connection, Packet packet ) : void
connection IConnection
packet Packet
리턴 void

SocketServer() 공개 메소드

使用默认配置参数的构造函数
public SocketServer ( IServerHandler handler, IEncoder encoder, IDecoder decoder ) : System
handler IServerHandler
encoder IEncoder
decoder IDecoder
리턴 System

SocketServer() 공개 메소드

new
socketService is null. protocol is null. maxMessageSize maxConnections
public SocketServer ( IServerHandler handler, Protocol protocol, int socketBufferSize, int messageBufferSize, int maxMessageSize, int maxConnections ) : System
handler IServerHandler
protocol Protocol
socketBufferSize int
messageBufferSize int
maxMessageSize int
maxConnections int
리턴 System

Start() 공개 메소드

start
public Start ( ) : void
리턴 void

Stop() 공개 메소드

stop
public Stop ( ) : void
리턴 void