C# Class Org.Mentalis.Proxy.Client

Specifies the basic methods and properties of a Client object. This is an abstract class and must be inherited.
The Client class provides an abstract base class that represents a connection to a local client and a remote server. Descendant classes further specify the protocol that is used between those two connections.
Inheritance: IDisposable
ファイルを表示 Open project: paratechnical/Seringa Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
Client ( ) : System

Initializes a new instance of the Client object.

Both the ClientSocket property and the DestroyDelegate are initialized to null.

Client ( Socket ClientSocket, DestroyDelegate Destroyer ) : System

Initializes a new instance of the Client class.

Dispose ( ) : void

Disposes of the resources (other than memory) used by the Client.

Closes the connections with the local client and the remote host. Once Dispose has been called, this object should not be used anymore.

StartHandshake ( ) : void

Starts communication with the local client.

StartRelay ( ) : void

Starts relaying data between the remote host and the local client.

This method should only be called after all protocol specific communication has been finished.

ToString ( ) : string

Returns text information about this Client object.

Protected Methods

Method Description
OnClientReceive ( IAsyncResult ar ) : void

Called when we have received data from the local client.
Incoming data will immediately be forwarded to the remote host.

OnClientSent ( IAsyncResult ar ) : void

Called when we have sent data to the local client.
When all the data has been sent, we will start receiving again from the remote host.

OnRemoteReceive ( IAsyncResult ar ) : void

Called when we have received data from the remote host.
Incoming data will immediately be forwarded to the local client.

OnRemoteSent ( IAsyncResult ar ) : void

Called when we have sent data to the remote host.
When all the data has been sent, we will start receiving again from the local client.

Method Details

Client() public method

Initializes a new instance of the Client object.
Both the ClientSocket property and the DestroyDelegate are initialized to null.
public Client ( ) : System
return System

Client() public method

Initializes a new instance of the Client class.
public Client ( Socket ClientSocket, DestroyDelegate Destroyer ) : System
ClientSocket Socket The Socket connection between this proxy server and the local client.
Destroyer DestroyDelegate The callback method to be called when this Client object disconnects from the local client and the remote server.
return System

Dispose() public method

Disposes of the resources (other than memory) used by the Client.
Closes the connections with the local client and the remote host. Once Dispose has been called, this object should not be used anymore.
public Dispose ( ) : void
return void

OnClientReceive() protected method

Called when we have received data from the local client.
Incoming data will immediately be forwarded to the remote host.
protected OnClientReceive ( IAsyncResult ar ) : void
ar IAsyncResult The result of the asynchronous operation.
return void

OnClientSent() protected method

Called when we have sent data to the local client.
When all the data has been sent, we will start receiving again from the remote host.
protected OnClientSent ( IAsyncResult ar ) : void
ar IAsyncResult The result of the asynchronous operation.
return void

OnRemoteReceive() protected method

Called when we have received data from the remote host.
Incoming data will immediately be forwarded to the local client.
protected OnRemoteReceive ( IAsyncResult ar ) : void
ar IAsyncResult The result of the asynchronous operation.
return void

OnRemoteSent() protected method

Called when we have sent data to the remote host.
When all the data has been sent, we will start receiving again from the local client.
protected OnRemoteSent ( IAsyncResult ar ) : void
ar IAsyncResult The result of the asynchronous operation.
return void

StartHandshake() public abstract method

Starts communication with the local client.
public abstract StartHandshake ( ) : void
return void

StartRelay() public method

Starts relaying data between the remote host and the local client.
This method should only be called after all protocol specific communication has been finished.
public StartRelay ( ) : void
return void

ToString() public method

Returns text information about this Client object.
public ToString ( ) : string
return string