C# Класс 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.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Описание методов

Client() публичный Метод

Initializes a new instance of the Client object.
Both the ClientSocket property and the DestroyDelegate are initialized to null.
public Client ( ) : System
Результат System

Client() публичный Метод

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.
Результат System

Dispose() публичный Метод

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
Результат void

OnClientReceive() защищенный Метод

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.
Результат void

OnClientSent() защищенный Метод

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.
Результат void

OnRemoteReceive() защищенный Метод

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.
Результат void

OnRemoteSent() защищенный Метод

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.
Результат void

StartHandshake() публичный абстрактный Метод

Starts communication with the local client.
public abstract StartHandshake ( ) : void
Результат void

StartRelay() публичный Метод

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
Результат void

ToString() публичный Метод

Returns text information about this Client object.
public ToString ( ) : string
Результат string