Méthode | Description | |
---|---|---|
Connect ( ) : void |
Connects the client to the server synchronously.
|
|
ConnectAsync ( ) : |
Connects the client to the server asynchronously. Derived classes are expected to override this method with protocol specific connection operations. Call the base class method to obtain an operational wait handle if protocol connection operation doesn't provide one already. |
|
Disconnect ( ) : void |
When overridden in a derived class, disconnects client from the server synchronously.
|
|
Dispose ( ) : void |
Releases the unmanaged resources used by the client and optionally releases the managed resources.
|
|
Initialize ( ) : void |
Initializes the client. Initialize() is to be called by user-code directly only if the client is not consumed through the designer surface of the IDE. |
|
Read ( byte buffer, int startIndex, int length ) : int |
Reads a number of bytes from the current received data buffer and writes those bytes into a byte array at the specified offset. This function should only be called from within the ClientBase.ReceiveData event handler. Calling this method outside this event will have unexpected results. |
|
Send ( byte data, int offset, int length ) : void |
Sends data to the server synchronously.
|
|
SendAsync ( byte data, int offset, int length ) : |
Sends data to the server asynchronously.
|
Méthode | Description | |
---|---|---|
GetLocalEndPoint ( ) : |
Determines the local end point this client intends to listen on via connection string properties.
|
|
GetSharedClient ( ) : void |
Gets a reference to the shared client listening on this client's local end point.
|
|
OnConnectionEstablished ( ) : void | ||
ReturnSharedClient ( ) : void |
Releases a reference to this client's shared client, and disposes of the shared client if nobody is using it.
|
|
SharedClient_ConnectionAttempt ( object sender, |
||
SharedClient_ConnectionEstablished ( object sender, |
||
SharedClient_ConnectionException ( object sender, EventArgs |
||
SharedClient_ConnectionTerminated ( object sender, |
||
SharedClient_ReceiveDataException ( object sender, EventArgs |
||
SharedClient_ReceiveDataFrom ( object sender, EventArgs |
||
SharedClient_SendDataException ( object sender, EventArgs |
||
SharedClient_UnhandledUserException ( object sender, EventArgs |
||
TerminateSharedClient ( ) : void |
Terminates the client as quickly as possible and removes it from the collection of shared clients.
|
public ConnectAsync ( ) : |
||
Résultat |
public Read ( byte buffer, int startIndex, int length ) : int | ||
buffer | byte | Destination buffer used to hold copied bytes. |
startIndex | int | 0-based starting index into destination |
length | int | The number of bytes to read from current received data buffer and write into |
Résultat | int |
public Send ( byte data, int offset, int length ) : void | ||
data | byte | The buffer that contains the binary data to be sent. |
offset | int | The zero-based position in the |
length | int | The number of bytes to be sent from |
Résultat | void |
public SendAsync ( byte data, int offset, int length ) : |
||
data | byte | The buffer that contains the binary data to be sent. |
offset | int | The zero-based position in the |
length | int | The number of bytes to be sent from |
Résultat |