C# Class NSocket.SocketLib.SocketClient

Inheritance: IDisposable
Mostra file Open project: ODotNet/NSocket Class Usage Examples

Public Methods

Method Description
Connect ( ) : bool

连接服务端

Disconnect ( ) : void

断开连接

Dispose ( ) : void
Listen ( ) : void

开始监听线程的入口函数

Send ( byte sendBuffer ) : void

发送信息

SocketClient ( IPAddress address, Int32 port, int messageBuffer ) : System

初始化客户端

Private Methods

Method Description
OnConnect ( object sender, SocketAsyncEventArgs e ) : void

连接的完成方法

OnReceive ( object sender, SocketAsyncEventArgs e ) : void

接收的完成方法

OnSend ( object sender, SocketAsyncEventArgs e ) : void

发送的完成方法

Method Details

Connect() public method

连接服务端
public Connect ( ) : bool
return bool

Disconnect() public method

断开连接
public Disconnect ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

Listen() public method

开始监听线程的入口函数
public Listen ( ) : void
return void

Send() public method

发送信息
public Send ( byte sendBuffer ) : void
sendBuffer byte
return void

SocketClient() public method

初始化客户端
public SocketClient ( IPAddress address, Int32 port, int messageBuffer ) : System
address System.Net.IPAddress 服务端地址{IP地址}
port System.Int32 端口号
messageBuffer int
return System