Property | Type | Description | |
---|---|---|---|
BeginInit | void | ||
EndInit | void |
Method | Description | |
---|---|---|
Create ( string configurationString ) : IServer |
Create a communications server Note that typical configuration string should be prefixed with a "protocol=tcp" or a "protocol=udp" |
|
DisconnectAll ( ) : void |
Disconnects all of the connected clients.
|
|
DisconnectOne ( System.Guid clientID ) : void |
When overridden in a derived class, disconnects a connected client.
|
|
Initialize ( ) : void |
Initializes the server. Initialize() is to be called by user-code directly only if the server is not consumed through the designer surface of the IDE. |
|
IsClientConnected ( System.Guid clientID ) : bool |
Determines whether the given client is currently connected to the server.
|
|
LoadSettings ( ) : void |
Loads saved server settings from the config file if the PersistSettings property is set to true.
|
|
Multicast ( byte data ) : void |
Sends data to all of the connected clients synchronously.
|
|
Multicast ( byte data, int offset, int length ) : void |
Sends data to all of the connected clients synchronously.
|
|
Multicast ( object serializableObject ) : void |
Sends data to all of the connected clients synchronously.
|
|
Multicast ( string data ) : void |
Sends data to all of the connected clients synchronously.
|
|
MulticastAsync ( byte data ) : WaitHandle[] |
Sends data to all of the connected clients asynchronously.
|
|
MulticastAsync ( byte data, int offset, int length ) : WaitHandle[] |
Sends data to all of the connected clients asynchronously.
|
|
MulticastAsync ( object serializableObject ) : WaitHandle[] |
Sends data to all of the connected clients asynchronously.
|
|
MulticastAsync ( string data ) : WaitHandle[] |
Sends data to all of the connected clients asynchronously.
|
|
Read ( Guid clientID, 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 ReceiveClientData event handler. Calling this method outside this event will have unexpected results. |
|
SaveSettings ( ) : void |
Saves server settings to the config file if the PersistSettings property is set to true.
|
|
SendTo ( Guid clientID, byte data ) : void |
Sends data to the specified client synchronously.
|
|
SendTo ( Guid clientID, byte data, int offset, int length ) : void |
Sends data to the specified client synchronously.
|
|
SendTo ( Guid clientID, object serializableObject ) : void |
Sends data to the specified client synchronously.
|
|
SendTo ( Guid clientID, string data ) : void |
Sends data to the specified client synchronously.
|
|
SendToAsync ( Guid clientID, byte data ) : WaitHandle |
Sends data to the specified client asynchronously.
|
|
SendToAsync ( Guid clientID, byte data, int offset, int length ) : WaitHandle |
Sends data to the specified client asynchronously.
|
|
SendToAsync ( Guid clientID, object serializableObject ) : WaitHandle |
Sends data to the specified client asynchronously.
|
|
SendToAsync ( Guid clientID, string data ) : WaitHandle |
Sends data to the specified client asynchronously.
|
|
Start ( ) : void |
When overridden in a derived class, starts the server.
|
|
Stop ( ) : void |
When overridden in a derived class, stops the server.
|
Method | Description | |
---|---|---|
Dispose ( bool disposing ) : void |
Releases the unmanaged resources used by the server and optionally releases the managed resources.
|
|
OnClientConnected ( Guid clientID ) : void |
Raises the ClientConnected event.
|
|
OnClientConnectingException ( Exception ex ) : void |
Raises the ClientConnectingException event.
|
|
OnClientDisconnected ( Guid clientID ) : void |
Raises the ClientDisconnected event.
|
|
OnReceiveClientData ( Guid clientID, int size ) : void |
Raises the ReceiveClientData event. This event is automatically raised by call to OnReceiveClientDataComplete so that inheritors never need to worry about raising this event. This method is only included here in case any custom server implementations need to explicitly raise this event. |
|
OnReceiveClientDataComplete ( Guid clientID, byte data, int size ) : void |
Raises the ReceiveClientDataComplete event.
|
|
OnReceiveClientDataException ( Guid clientID, Exception ex ) : void |
Raises the ReceiveClientDataException event.
|
|
OnSendClientDataComplete ( Guid clientID ) : void |
Raises the SendClientDataComplete event.
|
|
OnSendClientDataException ( Guid clientID, Exception ex ) : void |
Raises the SendClientDataException event.
|
|
OnSendClientDataStart ( Guid clientID ) : void |
Raises the SendClientDataStart event.
|
|
OnServerStarted ( ) : void |
Raises the ServerStarted event.
|
|
OnServerStopped ( ) : void |
Raises the ServerStopped event.
|
|
OnUnhandledUserException ( Exception ex ) : void |
Raises the UnhandledUserException event.
|
|
ReStart ( ) : void |
Re-starts the server if currently running.
|
|
SendDataToAsync ( Guid clientID, byte data, int offset, int length ) : WaitHandle |
When overridden in a derived class, sends data to the specified client asynchronously.
|
|
ServerBase ( ) : System |
Initializes a new instance of the server.
|
|
ServerBase ( TransportProtocol transportProtocol, string configurationString ) : System |
Initializes a new instance of the server.
|
|
ValidateConfigurationString ( string configurationString ) : void |
When overridden in a derived class, validates the specified configurationString.
|
Method | Description | |
---|---|---|
BeginInit ( ) : void | ||
EndInit ( ) : void |
public static Create ( string configurationString ) : IServer | ||
configurationString | string | The configuration string for the server. |
return | IServer |
public abstract DisconnectOne ( System.Guid clientID ) : void | ||
clientID | System.Guid | ID of the client to be disconnected. |
return | void |
protected Dispose ( bool disposing ) : void | ||
disposing | bool | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
return | void |
public IsClientConnected ( System.Guid clientID ) : bool | ||
clientID | System.Guid | The ID of the client. |
return | bool |
public Multicast ( byte data ) : void | ||
data | byte | The binary data that is to be sent. |
return | void |
public Multicast ( 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 |
return | void |
public Multicast ( object serializableObject ) : void | ||
serializableObject | object | The serializable object that is to be sent. |
return | void |
public Multicast ( string data ) : void | ||
data | string | The plain-text data that is to be sent. |
return | void |
public MulticastAsync ( byte data ) : WaitHandle[] | ||
data | byte | The binary data that is to be sent. |
return | WaitHandle[] |
public MulticastAsync ( byte data, int offset, int length ) : WaitHandle[] | ||
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 |
return | WaitHandle[] |
public MulticastAsync ( object serializableObject ) : WaitHandle[] | ||
serializableObject | object | The serializable object that is to be sent. |
return | WaitHandle[] |
public MulticastAsync ( string data ) : WaitHandle[] | ||
data | string | The plain-text data that is to be sent. |
return | WaitHandle[] |
protected OnClientConnected ( Guid clientID ) : void | ||
clientID | Guid | ID of client to send to |
return | void |
protected OnClientConnectingException ( Exception ex ) : void | ||
ex | Exception | The |
return | void |
protected OnClientDisconnected ( Guid clientID ) : void | ||
clientID | Guid | ID of client to send to |
return | void |
protected OnReceiveClientData ( Guid clientID, int size ) : void | ||
clientID | Guid | ID of the client from which data is received. |
size | int | Number of bytes received from the client. |
return | void |
protected OnReceiveClientDataComplete ( Guid clientID, byte data, int size ) : void | ||
clientID | Guid | ID of the client from which data is received. |
data | byte | Data received from the client. |
size | int | Number of bytes received from the client. |
return | void |
protected OnReceiveClientDataException ( Guid clientID, Exception ex ) : void | ||
clientID | Guid | ID of client to send to |
ex | Exception | Exception to send to |
return | void |
protected OnSendClientDataComplete ( Guid clientID ) : void | ||
clientID | Guid | ID of client to send to |
return | void |
protected OnSendClientDataException ( Guid clientID, Exception ex ) : void | ||
clientID | Guid | ID of client to send to |
ex | Exception | Exception to send to |
return | void |
protected OnSendClientDataStart ( Guid clientID ) : void | ||
clientID | Guid | ID of client to send to |
return | void |
protected OnUnhandledUserException ( Exception ex ) : void | ||
ex | Exception | Exception to send to |
return | void |
public abstract Read ( Guid clientID, byte buffer, int startIndex, int length ) : int | ||
clientID | Guid | ID of the client from which data buffer should be read. |
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 |
return | int |
protected abstract SendDataToAsync ( Guid clientID, byte data, int offset, int length ) : WaitHandle | ||
clientID | Guid | ID of the client to which the data is to be sent. |
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 |
return | WaitHandle |
public SendTo ( Guid clientID, byte data ) : void | ||
clientID | Guid | ID of the client to which the data is to be sent. |
data | byte | The binary data that is to be sent. |
return | void |
public SendTo ( Guid clientID, byte data, int offset, int length ) : void | ||
clientID | Guid | ID of the client to which the data is to be sent. |
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 |
return | void |
public SendTo ( Guid clientID, object serializableObject ) : void | ||
clientID | Guid | ID of the client to which the data is to be sent. |
serializableObject | object | The serializable object that is to be sent. |
return | void |
public SendTo ( Guid clientID, string data ) : void | ||
clientID | Guid | ID of the client to which the data is to be sent. |
data | string | The plain-text data that is to be sent. |
return | void |
public SendToAsync ( Guid clientID, byte data ) : WaitHandle | ||
clientID | Guid | ID of the client to which the data is to be sent. |
data | byte | The binary data that is to be sent. |
return | WaitHandle |
public SendToAsync ( Guid clientID, byte data, int offset, int length ) : WaitHandle | ||
clientID | Guid | ID of the client to which the data is to be sent. |
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 |
return | WaitHandle |
public SendToAsync ( Guid clientID, object serializableObject ) : WaitHandle | ||
clientID | Guid | ID of the client to which the data is to be sent. |
serializableObject | object | The serializable object that is to be sent. |
return | WaitHandle |
public SendToAsync ( Guid clientID, string data ) : WaitHandle | ||
clientID | Guid | ID of the client to which the data is to be sent. |
data | string | The plain-text data that is to be sent. |
return | WaitHandle |
protected ServerBase ( TransportProtocol transportProtocol, string configurationString ) : System | ||
transportProtocol | TransportProtocol | One of the |
configurationString | string | The data used by the server for initialization. |
return | System |
protected abstract ValidateConfigurationString ( string configurationString ) : void | ||
configurationString | string | The configuration string to be validated. |
return | void |