C# Class EpServerEngine.cs.IocpTcpClient

A IOCP TCP Client class.
Inheritance: ThreadEx, INetworkClient, IDisposable
Datei anzeigen Open project: juhgiyo/EpServerEngine.cs Class Usage Examples

Private Properties

Property Type Description
Dispose void
onConnected void
onReceived void
onSent void
startReceive void

Public Methods

Method Description
Connect ( EpServerEngine.cs.ClientOps ops ) : void

Connect to the server with given options

Disconnect ( ) : void

Disconnect from the server

Dispose ( ) : void
IocpTcpClient ( ) : System

Default constructor

IocpTcpClient ( IocpTcpClient b ) : System

Default copy constructor

Send ( EpServerEngine.cs.Packet packet ) : void

Send given packet to the server

Send ( byte data ) : void

Send given data to the server

Send ( byte data, int offset, int dataSize ) : void

Send given data to the server

Protected Methods

Method Description
execute ( ) : void

Make the connection to the server and start receiving

Private Methods

Method Description
Dispose ( bool isDisposing ) : void
onConnected ( IAsyncResult result ) : void

Connection callback function

onReceived ( IAsyncResult result ) : void

Receive callback function

onSent ( IAsyncResult result ) : void

Send callback function

startReceive ( ) : void

Start to receive packet from the server

Method Details

Connect() public method

Connect to the server with given options
public Connect ( EpServerEngine.cs.ClientOps ops ) : void
ops EpServerEngine.cs.ClientOps options for client
return void

Disconnect() public method

Disconnect from the server
public Disconnect ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

IocpTcpClient() public method

Default constructor
public IocpTcpClient ( ) : System
return System

IocpTcpClient() public method

Default copy constructor
public IocpTcpClient ( IocpTcpClient b ) : System
b IocpTcpClient the object to copy from
return System

Send() public method

Send given packet to the server
public Send ( EpServerEngine.cs.Packet packet ) : void
packet EpServerEngine.cs.Packet packet to send
return void

Send() public method

Send given data to the server
public Send ( byte data ) : void
data byte data in byte array
return void

Send() public method

Send given data to the server
public Send ( byte data, int offset, int dataSize ) : void
data byte data in byte array
offset int offset in bytes
dataSize int data size in bytes
return void

execute() protected method

Make the connection to the server and start receiving
protected execute ( ) : void
return void