![]() |
DEPRECATED: Diffusion Silverlight Classic API
5.9.4
|
This class controls the way that a connection is made to Diffusion. The supplied connection details determine how connections are made, i.e. 'http://localhost:8080' or 'dpt://localhost:8080'. Note that more than one set of connection details may be supplied using the AddServerDetails(ServerDetails) method, and cleared using the ClearServerDetails method. More...
Public Member Functions | |
PagedTopicHandler | CreatePagedTopicHandler (TopicMessage message, IPagedTopicListener listener) |
Creates a handler object for a 'Paged' topic. This would be called in response to receiving an 'IsPagedLoad' message from a paged topic as a result of subscribing to it. Note that no other messages would be received from a service topic other than via the specified IPagedTopicListener. More... | |
DiffusionClient (Dispatcher dispatcher) | |
Constructor. More... | |
DiffusionClient (Dispatcher dispatcher, byte socketTransportType, string httpTransportType) | |
Constructor. More... | |
void | AddServerDetails (ServerDetails details) |
Adds the details of a Diffusion connection descriptor. More... | |
void | ClearServerDetails () |
Clears the server details. More... | |
void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
int | AddTopicListener (string pattern, Func< TopicMessage, bool > function, object context) |
Adds a topic listener. More... | |
void | RemoveTopicListener (int handle) |
Removes a topic listener given its handle. More... | |
void | RemoveAllTopicListeners () |
Removes all topic listeners. More... | |
void | Connect (ConnectionDetails connectionDetails=null) |
Connect to the Diffusion server using the specified connection details. The connection details should be instantiated and supplied prior to calling this. More... | |
void | Reconnect () |
Attempts to re-establish a connection to the Diffusion server. More... | |
void | Close () |
Closes down gracefully and disconnects from the Diffusion server. Note that topic listeners must be explicitly removed by the developer. More... | |
void | SendTopicMessage (TopicMessage message) |
Sends a topic message with no encoding to the Diffusion server. More... | |
void | SendTopicMessageEncrypted (TopicMessage message) |
Sends a topic message to the Diffusion server and encrypts it automatically prior to sending to Diffusion. More... | |
void | SendTopicMessageCompressed (TopicMessage message) |
Sends a topic message to the Diffusion server and compresses it automatically prior to sending to Diffusion. More... | |
void | SendTopicMessageBase64 (TopicMessage message) |
Sends a Base64 encoded topic message to the Diffusion server and Base64 encodes it automatically prior to sending to Diffusion. More... | |
void | Send (string topic, string message) |
Sends a message to a particular topic. More... | |
void | Subscribe (string topics) |
Subscribes to topics (multiple topics should be comma-delimited) More... | |
void | Unsubscribe (string topics) |
Unsubscribe from topics (multiple topics should be comma-delimited). More... | |
void | Ping (string timeStamp=null, string queueSize="0") |
Send a ping request to the Diffusion server; the server will respond with a ping message. Note that if empty values are supplied, they will be automatically generated. More... | |
void | Fetch (string topic, params string[] headers) |
Fetch the initial topic load for the topic. More... | |
ServiceTopicHandler | CreateServiceTopicHandler (TopicMessage message, IServiceTopicListener listener) |
Creates a handler object for a 'Service' topic. This would be called in response to receiving an 'IsServiceLoad' message from a service topic as a result of subscribing to it. Note that no other messages would be received from a service topic other than via the specified IServiceTopicListener. More... | |
void | SendCredentials (DiffusionClientCredentials credentials) |
Sends the credentials to the Diffusion server. If the credentials are rejected by the server, a DiffusionEventBus.ServerRejectedCredentials event will be fired. More... | |
void | Acknowledge (TopicMessage message) |
Sends a message acknowledgement back to the Diffusion server if auto acknowledgements are not enabled. More... | |
void | SendAckResponse (string ackId) |
Used to manually send an acknowledgement message to the Diffusion server. More... | |
void | RaiseTraceDebugMessage (object sender, string message) |
Routes an internal 'debug' message to subscribers. More... | |
Static Public Member Functions | |
static string | GetVersionNumber () |
Returns the version number of this assembly in the form 'DiffusionClient X.X.X.X'. More... | |
Properties | |
bool | IsConnected [get] |
Returns the connection state of the active transport. More... | |
string | ClientId [get] |
Returns the client id of the active transport. More... | |
int | ServerProtocolVersion [get] |
Returns the server protocol version. More... | |
string | Host [get, set] |
Get/set the host or IP address of the Diffusion server that the Diffusion client will try to connect to if using the Socket transport. More... | |
int | Port [get, set] |
Get/set the port of the Diffusion server that the Diffusion client will try to connect to if using the Socket transport. More... | |
string | ServerContext [get, set] |
Get/set the http context of the Diffusion server. Defaults to '/diffusion/'. More... | |
int | HttpConnectivityMonitorFrequency [get, set] |
The frequency at which to monitor http connectivity. More... | |
string | Topics [get, set] |
Get/set the topics to connect to the Diffusion server with. More... | |
string | Url [get, set] |
Get/set the url which will be used if the Http transport is to be used. The /diffusion context will be automatically added. More... | |
TransportType | TransportType [get, set] |
Get/set the current transport mode. If connected this will reflect which transport type is being used in the current session with the Diffusion server. More... | |
DiffusionClientCredentials | Credentials [get, set] |
Get/set the credentials which will be used in the connection to the Diffusion server. More... | |
bool | IsHandlingAcks [get, set] |
Sets whether message acknowledgement is automatic (true) or manual (false). More... | |
bool | AutoAck [get, set] |
Get/set whether the API automatically sends message acknowledgements back to the Diffusion server. If true, message acknowledgements will be sent automatically, otherwise the developer will have to manually respond to the acknowledge message via the IDiffusionTransport.Acknowlege() method. More... | |
int | ClientProtocolVersion [get] |
Returns the client protocol version. More... | |
bool | AutoFailover [get, set] |
Get/set whether to set the 'auto failover' option. By default when a connection is lost then notification is given and the connection simply closed. However, if 'auto failover' is specified then if a connection is lost then an automatic attempt will be made to connect using the next server details (assuming more than one was provided). More... | |
bool | IsLoadBalancing [get, set] |
Get/set whether we will be load-balancing the connection attempts. More... | |
bool | RestoreState [get, set] |
Get/set whether to attempt to restore the state, (i.e. topic subscriptions) after a loss of connection and subsequent reconnection. More... | |
bool | Cascade [get, set] |
Get/set whether to cycle through all connection details to attempt to establish a connection to the Diffusion server. More... | |
int | TransportTimeout [get, set] |
Gets/sets the transport timeout. More... | |
NetworkStackType | StackType [get, set] |
Get/set the networking stack to use. More... | |
ServerDetails | ActiveServerDetails [get] |
Gets the server details which are currently in use for connection. More... | |
DateTime | LastInteraction [get] |
Returns the time of the last interaction (send or receive) with the Diffusion server. More... | |
EventHandler < ConnectionDetailsAcquiredEventArgs > | ConnectionDetailsAcquired |
The event fired when a set of server details has been acquired prior to a connection attempt. More... | |
EventHandler< EventArgs > | ConnectionSequenceExhausted |
The event fired when the sequence of connection details has been exhausted. More... | |
![]() | |
bool | IsConnected [get] |
Returns the connection state of the active transport. More... | |
string | ClientId [get] |
Returns the client id of the active transport. More... | |
int | ServerProtocolVersion [get] |
Returns the server protocol version. More... | |
string | Host [get, set] |
Get/set the host or IP address of the Diffusion server that the Diffusion client will try to connect to if using the Socket transport. More... | |
int | Port [get, set] |
Get/set the port of the Diffusion server that the Diffusion client will try to connect to if using the Socket transport. More... | |
string | Topics [get, set] |
Get/set the topics to connect to the Diffusion server with. More... | |
string | Url [get, set] |
Get/set the url which will be used if the Http transport is to be used. The /diffusion context will be automatically added. More... | |
TransportType | TransportType [get, set] |
Get/set the current transport mode. If connected this will reflect which transport type is being used in the current session with the Diffusion server. More... | |
DiffusionClientCredentials | Credentials [get, set] |
Get/set the credentials which will be used in the connection to the Diffusion server. More... | |
bool | IsHandlingAcks [get, set] |
Sets whether message acknowledgement is automatic (true) or manual (false). More... | |
bool | AutoAck [get, set] |
Get/set whether the API automatically sends message acknowledgements back to the Diffusion server. More... | |
int | ClientProtocolVersion [get] |
Returns the client protocol version. More... | |
int | TransportTimeout [get, set] |
Gets/sets the transport timeout. More... | |
NetworkStackType | StackType [get, set] |
Get/set the networking stack to use. More... | |
string | ServerContext [get, set] |
Get/set the http context of the Diffusion server. Defaults to '/diffusion/'. More... | |
int | HttpConnectivityMonitorFrequency [get, set] |
The frequency at which to monitor http connectivity. More... | |
bool | AutoFailover [get, set] |
Get/set whether to set the 'auto failover' option. More... | |
bool | IsLoadBalancing [get, set] |
Get/set whether we will be load-balancing the connection attempts. More... | |
bool | RestoreState [get, set] |
Get/set whether to attempt to restore the state, i.e. topic subscriptions etc. after a loss of connection and subsequent reconnection. More... | |
bool | Cascade [get, set] |
Get/set whether to cycle through all connection details to attempt to establish a connection to the Diffusion server. More... | |
ServerDetails | ActiveServerDetails [get] |
Get the server details that are currently being used for connection to Diffusion. More... | |
DateTime | LastInteraction [get] |
Returns the time of the last interaction (send or receive) with the Diffusion server. More... | |
Events | |
EventHandler < TopicMessageEventArgs > | MessageReceived |
The event fired when a message is received from the Diffusion server. More... | |
EventHandler < DiffusionConnectionStatusEventArgs > | ConnectionStatus |
The event fired when the connection status to the Diffusion server changes. More... | |
EventHandler < TopicMessageEventArgs > | ServerRejectedCredentials |
The event fired when the Diffusion server has rejected credentials. More... | |
EventHandler < MessageNotAcknowledgedEventArgs > | MessageNotAcknowledged |
The event fired when a message has not been acknowledged by the Diffusion server. More... | |
EventHandler < AckResponseMessageEventArgs > | AckMessageReceived |
The event fired when an acknowledgment received message is received from the Diffusion server. More... | |
EventHandler < TraceMessageEventArgs > | DiffusionTraceEvent |
The event fired when 'debug' information is sent. More... | |
EventHandler < TopicStatusMessageEventArgs > | TopicStatusMessageReceived |
The event fired when a topic status message is received. More... | |
![]() | |
EventHandler < TopicMessageEventArgs > | MessageReceived |
The event fired when a message is received from the Diffusion server. More... | |
EventHandler < DiffusionConnectionStatusEventArgs > | ConnectionStatus |
The event fired when the connection status to the Diffusion server changes. More... | |
EventHandler < TopicMessageEventArgs > | ServerRejectedCredentials |
The event fired when the Diffusion server has rejected credentials. More... | |
EventHandler < MessageNotAcknowledgedEventArgs > | MessageNotAcknowledged |
The event fired when a message has not been acknowledged by the Diffusion server. More... | |
EventHandler < AckResponseMessageEventArgs > | AckMessageReceived |
The event fired when an acknowledgement received message is received from the Diffusion server. More... | |
EventHandler < TraceMessageEventArgs > | DiffusionTraceEvent |
The event fired when 'debug' information is sent. More... | |
EventHandler < TopicStatusMessageEventArgs > | TopicStatusMessageReceived |
The event fired when a topic status message is received. More... | |
EventHandler < ConnectionDetailsAcquiredEventArgs > | ConnectionDetailsAcquired |
The event fired when a set of server details has been acquired prior to a connection attempt. More... | |
EventHandler< EventArgs > | ConnectionSequenceExhausted |
The event fired when the sequence of connection details has been exhausted. More... | |
This class controls the way that a connection is made to Diffusion. The supplied connection details determine how connections are made, i.e. 'http://localhost:8080' or 'dpt://localhost:8080'. Note that more than one set of connection details may be supplied using the AddServerDetails(ServerDetails) method, and cleared using the ClearServerDetails method.
Alternatively the connection details may be provided by instantiating a <see cref="ConnectionDetails"/> object and adding <see cref="ServerDetails"/> objects to it, then the object should be passed to the <see cref="Connect(ConnectionDetails)"/> method.
PushTechnology.Transports.DiffusionClient.DiffusionClient | ( | Dispatcher | dispatcher | ) |
Constructor.
PushTechnology.Transports.DiffusionClient.DiffusionClient | ( | Dispatcher | dispatcher, |
byte | socketTransportType, | ||
string | httpTransportType | ||
) |
Constructor.
void PushTechnology.Transports.DiffusionClient.Acknowledge | ( | TopicMessage | message | ) |
Sends a message acknowledgement back to the Diffusion server if auto acknowledgements are not enabled.
message | The topic message. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.AddServerDetails | ( | ServerDetails | details | ) |
Adds the details of a Diffusion connection descriptor.
details | The server details. |
Implements PushTechnology.Transports.IDiffusionClient.
int PushTechnology.Transports.DiffusionClient.AddTopicListener | ( | string | pattern, |
Func< TopicMessage, bool > | function, | ||
object | context | ||
) |
Adds a topic listener.
pattern | The regular expression pattern for the topic(s) of interest. |
function | The callback method for message delivery. |
context | A context object. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.ClearServerDetails | ( | ) |
Clears the server details.
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.Close | ( | ) |
Closes down gracefully and disconnects from the Diffusion server. Note that topic listeners must be explicitly removed by the developer.
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.Connect | ( | ConnectionDetails | connectionDetails = null | ) |
Connect to the Diffusion server using the specified connection details. The connection details should be instantiated and supplied prior to calling this.
connectionDetails | The connection details. |
ArgumentException | Thrown if connection details are not supplied. |
Implements PushTechnology.Transports.IDiffusionClient.
PagedTopicHandler PushTechnology.Transports.DiffusionClient.CreatePagedTopicHandler | ( | TopicMessage | message, |
IPagedTopicListener | listener | ||
) |
Creates a handler object for a 'Paged' topic. This would be called in response to receiving an 'IsPagedLoad' message from a paged topic as a result of subscribing to it. Note that no other messages would be received from a service topic other than via the specified IPagedTopicListener.
message | The load message received from the topic. |
listener | An object that is to receive all notifications from the Topic. |
Implements PushTechnology.Transports.IDiffusionClient.
ServiceTopicHandler PushTechnology.Transports.DiffusionClient.CreateServiceTopicHandler | ( | TopicMessage | message, |
IServiceTopicListener | listener | ||
) |
Creates a handler object for a 'Service' topic. This would be called in response to receiving an 'IsServiceLoad' message from a service topic as a result of subscribing to it. Note that no other messages would be received from a service topic other than via the specified IServiceTopicListener.
message | The load message received from the topic. |
listener | An object that is to receive all Service replies and notifications. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.Dispose | ( | ) |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.Fetch | ( | string | topic, |
params string[] | headers | ||
) |
Fetch the initial topic load for the topic.
topic | The topic on which to fetch the initial topic load. |
headers | Optional headers, which could include a correlation id. |
UnsupportedServerMethodException |
Implements PushTechnology.Transports.IDiffusionClient.
|
static |
Returns the version number of this assembly in the form 'DiffusionClient X.X.X.X'.
void PushTechnology.Transports.DiffusionClient.Ping | ( | string | timeStamp = null , |
string | queueSize = "0" |
||
) |
Send a ping request to the Diffusion server; the server will respond with a ping message. Note that if empty values are supplied, they will be automatically generated.
timeStamp | The time, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC. |
queueSize | A placeholder for the queue size. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.RaiseTraceDebugMessage | ( | object | sender, |
string | message | ||
) |
Routes an internal 'debug' message to subscribers.
sender | The sender of the message. |
message | The message to send. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.Reconnect | ( | ) |
Attempts to re-establish a connection to the Diffusion server.
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.RemoveAllTopicListeners | ( | ) |
Removes all topic listeners.
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.RemoveTopicListener | ( | int | handle | ) |
Removes a topic listener given its handle.
handle | The 'handle', or identifier of the topic listener. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.Send | ( | string | topic, |
string | message | ||
) |
Sends a message to a particular topic.
topic | The topic which should receive the message. |
message | The topic message to send. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.SendAckResponse | ( | string | ackId | ) |
Used to manually send an acknowledgement message to the Diffusion server.
ackId | The acknowledgement id. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.SendCredentials | ( | DiffusionClientCredentials | credentials | ) |
Sends the credentials to the Diffusion server. If the credentials are rejected by the server, a DiffusionEventBus.ServerRejectedCredentials event will be fired.
credentials | The credentials to send to the server. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.SendTopicMessage | ( | TopicMessage | message | ) |
Sends a topic message with no encoding to the Diffusion server.
message | The topic message to send. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.SendTopicMessageBase64 | ( | TopicMessage | message | ) |
Sends a Base64 encoded topic message to the Diffusion server and Base64 encodes it automatically prior to sending to Diffusion.
message | The topic message to send. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.SendTopicMessageCompressed | ( | TopicMessage | message | ) |
Sends a topic message to the Diffusion server and compresses it automatically prior to sending to Diffusion.
message | The topic message to send. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.SendTopicMessageEncrypted | ( | TopicMessage | message | ) |
Sends a topic message to the Diffusion server and encrypts it automatically prior to sending to Diffusion.
message | The topic message to send. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.Subscribe | ( | string | topics | ) |
Subscribes to topics (multiple topics should be comma-delimited)
topics | The topic names to subscribe to. |
Implements PushTechnology.Transports.IDiffusionClient.
void PushTechnology.Transports.DiffusionClient.Unsubscribe | ( | string | topics | ) |
Unsubscribe from topics (multiple topics should be comma-delimited).
topics | The topic names to unsubscribe from. |
Implements PushTechnology.Transports.IDiffusionClient.
|
get |
Gets the server details which are currently in use for connection.
|
getset |
Get/set whether the API automatically sends message acknowledgements back to the Diffusion server. If true, message acknowledgements will be sent automatically, otherwise the developer will have to manually respond to the acknowledge message via the IDiffusionTransport.Acknowlege() method.
|
getset |
Get/set whether to set the 'auto failover' option. By default when a connection is lost then notification is given and the connection simply closed. However, if 'auto failover' is specified then if a connection is lost then an automatic attempt will be made to connect using the next server details (assuming more than one was provided).
|
getset |
Get/set whether to cycle through all connection details to attempt to establish a connection to the Diffusion server.
|
get |
Returns the client id of the active transport.
|
get |
Returns the client protocol version.
|
addremove |
The event fired when a set of server details has been acquired prior to a connection attempt.
|
addremove |
The event fired when the sequence of connection details has been exhausted.
|
getset |
Get/set the credentials which will be used in the connection to the Diffusion server.
|
getset |
Get/set the host or IP address of the Diffusion server that the Diffusion client will try to connect to if using the Socket transport.
|
getset |
The frequency at which to monitor http connectivity.
|
get |
Returns the connection state of the active transport.
|
getset |
Sets whether message acknowledgement is automatic (true) or manual (false).
|
getset |
Get/set whether we will be load-balancing the connection attempts.
|
get |
Returns the time of the last interaction (send or receive) with the Diffusion server.
|
getset |
Get/set the port of the Diffusion server that the Diffusion client will try to connect to if using the Socket transport.
|
getset |
Get/set whether to attempt to restore the state, (i.e. topic subscriptions) after a loss of connection and subsequent reconnection.
|
getset |
Get/set the http context of the Diffusion server. Defaults to '/diffusion/'.
|
get |
Returns the server protocol version.
|
getset |
Get/set the networking stack to use.
|
getset |
Get/set the topics to connect to the Diffusion server with.
|
getset |
Gets/sets the transport timeout.
|
getset |
Get/set the current transport mode. If connected this will reflect which transport type is being used in the current session with the Diffusion server.
|
getset |
Get/set the url which will be used if the Http transport is to be used. The /diffusion context will be automatically added.
EventHandler<AckResponseMessageEventArgs> PushTechnology.Transports.DiffusionClient.AckMessageReceived |
The event fired when an acknowledgment received message is received from the Diffusion server.
EventHandler<DiffusionConnectionStatusEventArgs> PushTechnology.Transports.DiffusionClient.ConnectionStatus |
The event fired when the connection status to the Diffusion server changes.
EventHandler<TraceMessageEventArgs> PushTechnology.Transports.DiffusionClient.DiffusionTraceEvent |
The event fired when 'debug' information is sent.
EventHandler<MessageNotAcknowledgedEventArgs> PushTechnology.Transports.DiffusionClient.MessageNotAcknowledged |
The event fired when a message has not been acknowledged by the Diffusion server.
EventHandler<TopicMessageEventArgs> PushTechnology.Transports.DiffusionClient.MessageReceived |
The event fired when a message is received from the Diffusion server.
EventHandler<TopicMessageEventArgs> PushTechnology.Transports.DiffusionClient.ServerRejectedCredentials |
The event fired when the Diffusion server has rejected credentials.
EventHandler<TopicStatusMessageEventArgs> PushTechnology.Transports.DiffusionClient.TopicStatusMessageReceived |
The event fired when a topic status message is received.