C# Class FastNetwork.SocketServer

socket 服务器
Inheritance: BaseSocketServer
Show file Open project: zhujunxxxxx/FastNetwork Class Usage Examples

Public Methods

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

Protected Methods

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

Private Methods

Method Description
listener_Accepted ( ISocketListener listener, IConnection connection ) : void

socket accepted handler

Method Details

AddListener() public method

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

OnConnected() protected method

OnConnected
protected OnConnected ( IConnection connection ) : void
connection IConnection
return void

OnDisconnected() protected method

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

OnError() protected method

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

OnMessageReceived() protected method

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

OnSendCallback() protected method

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

OnStartSending() protected method

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

SocketServer() public method

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

SocketServer() public method

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
return System

Start() public method

start
public Start ( ) : void
return void

Stop() public method

stop
public Stop ( ) : void
return void