Свойство | Тип | Описание | |
---|---|---|---|
ReConnect | void |
Метод | Описание | |
---|---|---|
BeginInit ( ) : void |
Performs necessary operations before the client properties are initialized. BeginInit() should never be called by user-code directly. This method exists solely for use by the designer if the server is consumed through the designer surface of the IDE. |
|
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. |
|
Create ( string connectionString ) : IClient |
Create a communications client Note that typical connection string should be prefixed with a "protocol=tcp", "protocol=udp", "protocol=serial" or "protocol=file" |
|
Disconnect ( ) : void |
When overridden in a derived class, disconnects client from the server synchronously.
|
|
EndInit ( ) : void |
Performs necessary operations after the client properties are initialized. EndInit() should never be called by user-code directly. This method exists solely for use by the designer if the server is consumed through the designer surface of the IDE. |
|
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. |
|
LoadSettings ( ) : void |
Loads saved client settings from the config file if the PersistSettings property is set to true.
|
|
Read ( byte buffer, int startIndex, int length ) : int |
When overridden in a derived class, 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 ReceiveData event handler. Calling this method outside this event will have unexpected results. |
|
SaveSettings ( ) : void |
Saves client settings to the config file if the PersistSettings property is set to true.
|
|
Send ( byte data ) : void |
Sends data to the server synchronously.
|
|
Send ( byte data, int offset, int length ) : void |
Sends data to the server synchronously.
|
|
Send ( object serializableObject ) : void |
Sends data to the server synchronously.
|
|
Send ( string data ) : void |
Sends data to the server synchronously.
|
|
SendAsync ( byte data ) : |
Sends data to the server asynchronously.
|
|
SendAsync ( byte data, int offset, int length ) : |
Sends data to the server asynchronously.
|
|
SendAsync ( object serializableObject ) : |
Sends data to the server asynchronously.
|
|
SendAsync ( string data ) : |
Sends data to the server asynchronously.
|
Метод | Описание | |
---|---|---|
ClientBase ( ) : System |
Initializes a new instance of the client.
|
|
ClientBase ( TransportProtocol transportProtocol, string connectionString ) : System |
Initializes a new instance of the client.
|
|
Dispose ( bool disposing ) : void |
Releases the unmanaged resources used by the client and optionally releases the managed resources.
|
|
OnConnectionAttempt ( ) : void |
Raises the ConnectionAttempt event.
|
|
OnConnectionEstablished ( ) : void |
Raises the ConnectionEstablished event.
|
|
OnConnectionException ( |
Raises the ConnectionException event.
|
|
OnConnectionTerminated ( ) : void |
Raises the ConnectionTerminated event.
|
|
OnReceiveData ( int size ) : void |
Raises the ReceiveData event. This event is automatically raised by call to OnReceiveDataComplete so that inheritors never need to worry about raising this event. This method is only included here in case any custom client implementations need to explicitly raise this event. |
|
OnReceiveDataComplete ( byte data, int size ) : void |
Raises the ReceiveDataComplete event.
|
|
OnReceiveDataException ( |
Raises the ReceiveDataException event.
|
|
OnSendDataComplete ( ) : void |
Raises the SendDataComplete event.
|
|
OnSendDataException ( |
Raises the SendDataException event.
|
|
OnSendDataStart ( ) : void |
Raises the SendDataStart event.
|
|
OnUnhandledUserException ( |
Raises the UnhandledUserException event.
|
|
SendDataAsync ( byte data, int offset, int length ) : |
When overridden in a derived class, sends data to the server asynchronously.
|
|
UpdateBytesReceived ( int bytes ) : void |
Updates the Statistics pertaining to bytes received.
|
|
UpdateBytesSent ( int bytes ) : void |
Updates the Statistics pertaining to bytes sent.
|
|
ValidateConnectionString ( string connectionString ) : void |
When overridden in a derived class, validates the specified connectionString.
|
Метод | Описание | |
---|---|---|
ReConnect ( ) : void |
Re-connects the client if currently connected.
|
protected ClientBase ( TransportProtocol transportProtocol, string connectionString ) : System | ||
transportProtocol | TransportProtocol | One of the |
connectionString | string | The data used by the client for connection to a server. |
Результат | System |
public ConnectAsync ( ) : |
||
Результат |
public static Create ( string connectionString ) : IClient | ||
connectionString | string | Connection string for the client. |
Результат | IClient |
protected Dispose ( bool disposing ) : void | ||
disposing | bool | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Результат | void |
protected OnConnectionEstablished ( ) : void | ||
Результат | void |
protected OnConnectionException ( |
||
ex | Exception to send to |
|
Результат | void |
protected OnConnectionTerminated ( ) : void | ||
Результат | void |
protected OnReceiveData ( int size ) : void | ||
size | int | Number of bytes received from the client. |
Результат | void |
protected OnReceiveDataComplete ( byte data, int size ) : void | ||
data | byte | Data received from the client. |
size | int | Number of bytes received from the client. |
Результат | void |
protected OnReceiveDataException ( |
||
ex | Exception to send to |
|
Результат | void |
protected OnSendDataException ( |
||
ex | Exception to send to |
|
Результат | void |
protected OnUnhandledUserException ( |
||
ex | Exception to send to |
|
Результат | void |
public abstract 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 |
Результат | int |
public Send ( byte data ) : void | ||
data | byte | The binary data that is to be sent. |
Результат | void |
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 |
Результат | void |
public Send ( object serializableObject ) : void | ||
serializableObject | object | The serializable object that is to be sent. |
Результат | void |
public Send ( string data ) : void | ||
data | string | The plain-text data that is to be sent. |
Результат | void |
public SendAsync ( byte data ) : |
||
data | byte | The binary data that is to be sent. |
Результат |
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 |
Результат |
public SendAsync ( object serializableObject ) : |
||
serializableObject | object | The serializable object that is to be sent. |
Результат |
public SendAsync ( string data ) : |
||
data | string | The plain-text data that is to be sent. |
Результат |
protected abstract SendDataAsync ( 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 |
Результат |
protected UpdateBytesReceived ( int bytes ) : void | ||
bytes | int | |
Результат | void |
protected UpdateBytesSent ( int bytes ) : void | ||
bytes | int | |
Результат | void |
protected abstract ValidateConnectionString ( string connectionString ) : void | ||
connectionString | string | The connection string to be validated. |
Результат | void |