C# Class NSocket.SocketLib.SocketListener

显示文件 Open project: ODotNet/NSocket Class Usage Examples

Public Methods

Method Description
Init ( ) : void

服务端初始化

Send ( string uid, string msg ) : void
SocketListener ( int receiveBufferSize, int numConcurrence ) : System

初始化服务器端

Start ( int port ) : void

启动服务器

Stop ( ) : void

停止服务器

Private Methods

Method Description
CloseClientConnection ( string uid ) : void
OnAcceptCompleted ( object sender, SocketAsyncEventArgs e ) : void

客户端连接请求处理事件

OnReceiveCompleted ( object sender, SocketAsyncEventArgs e ) : void
OnSendCompleted ( object sender, SocketAsyncEventArgs e ) : void
ProcessAccept ( SocketAsyncEventArgs e ) : void

客户端连接请求处理方法

ProcessReceive ( NSocketSocketAsyncEventArgs e ) : void
ReceiveListen ( NSocketSocketAsyncEventArgs e ) : void
StartAccept ( SocketAsyncEventArgs acceptEventArg ) : void

接受客户端的连接请求

WasteClientMonitorHandler ( object state ) : void

Method Details

Init() public method

服务端初始化
public Init ( ) : void
return void

Send() public method

public Send ( string uid, string msg ) : void
uid string
msg string
return void

SocketListener() public method

初始化服务器端
public SocketListener ( int receiveBufferSize, int numConcurrence ) : System
receiveBufferSize int
numConcurrence int
return System

Start() public method

启动服务器
public Start ( int port ) : void
port int
return void

Stop() public method

停止服务器
public Stop ( ) : void
return void