Diffusion .NET Classic API - Core and Common  5.9.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService Class Reference

The class responsible for sending ping messages to the Diffusion server at a specified interval. More...

Inheritance diagram for PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService:
PushTechnology.DiffusionCore.Connection.Interfaces.IServerConnectionListener PushTechnology.DiffusionCore.Messaging.Topic.ITopicListener

Public Member Functions

 DiffusionPingService (IDiffusionTopicConnector topicConnector, IDiffusionPingService receiver)
 Constructor. More...
 
void Start ()
 Start sending heartbeat messages at the given frequency. More...
 
void Stop ()
 Stops the service. More...
 
void ServerConnected (IDiffusionClientConnector connector)
 Notification of connection. More...
 
void ServerConnectionAttemptFailed (IDiffusionClientConnector connector, ServerClosedEventArgs args)
 Notification of a failed connection attempt. More...
 
void ServerTopicStatusChanged (IDiffusionClientConnector connector, string topicName, TopicStatus statusType)
 Notification that the status for a topic that was subscribed to has changed. More...
 
void ServerRejectedCredentials (IDiffusionClientConnector connector, V4Credentials credentials)
 Notification of rejected credentials from the server. More...
 
void ServerDisconnected (IDiffusionClientConnector connector, ServerClosedEventArgs args)
 Notification of disconnection. More...
 
bool HandleTopicMessage (IMessageSource source, ITopicMessage message)
 Handles a message received from an IMessageSource. More...
 

Properties

bool AutoStop [get, set]
 Determines whether the service should stop itself when it detects that the Diffusion server has closed. Otherwise, the service should be stopped manually. More...
 
int InactivityPeriod [get, set]
 Get/set the period of inactivity before the heartbeats restart. More...
 
bool SendingMessages [get, set]
 Is this service sending messages? More...
 
int Count [get, set]
 Get/set the number of ping messages to send. More...
 
int Frequency [get, set]
 Get/set the frequency at which to send heartbeat messages. More...
 

Events

EventHandler< EventArgs > Started
 The event fired when the ping service is started. More...
 
EventHandler< EventArgs > Stopped
 The event fired when the ping service is stopped. More...
 
EventHandler
< PingServiceEventArgs
OnPing
 The event fired when a ping is sent. More...
 

Detailed Description

The class responsible for sending ping messages to the Diffusion server at a specified interval.

Constructor & Destructor Documentation

PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.DiffusionPingService ( IDiffusionTopicConnector  topicConnector,
IDiffusionPingService  receiver 
)

Constructor.

Parameters
topicConnector
receiverThe recipient of the calls.

Member Function Documentation

bool PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.HandleTopicMessage ( IMessageSource  source,
ITopicMessage  message 
)

Handles a message received from an IMessageSource.

This will handle an incoming message from a specified source.

Parameters
sourceThe message source.
messageThe message.

Implements PushTechnology.DiffusionCore.Messaging.Topic.ITopicListener.

void PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.ServerConnected ( IDiffusionClientConnector  connector)

Notification of connection.

This is called when a connection to a server is established.

Parameters
connectorThe server connector.

Implements PushTechnology.DiffusionCore.Connection.Interfaces.IServerConnectionListener.

void PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.ServerConnectionAttemptFailed ( IDiffusionClientConnector  connector,
ServerClosedEventArgs  args 
)

Notification of a failed connection attempt.

The reason for the failure can be established by checking the state of the connection using IDiffusionClientConnector.State.

Parameters
connector
args

Implements PushTechnology.DiffusionCore.Connection.Interfaces.IServerConnectionListener.

void PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.ServerDisconnected ( IDiffusionClientConnector  connector,
ServerClosedEventArgs  args 
)

Notification of disconnection.

The reason for the disconnection can be established by checking the state of the connection using IDiffusionClientConnector.State.

Parameters
connectorThe server connector.
argsThe arguments which can be interrogated for the state and details of a server closure.

Implements PushTechnology.DiffusionCore.Connection.Interfaces.IServerConnectionListener.

void PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.ServerRejectedCredentials ( IDiffusionClientConnector  connector,
V4Credentials  credentials 
)

Notification of rejected credentials from the server.

Parameters
connector
credentials

Implements PushTechnology.DiffusionCore.Connection.Interfaces.IServerConnectionListener.

void PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.ServerTopicStatusChanged ( IDiffusionClientConnector  connector,
string  topicName,
TopicStatus  statusType 
)

Notification that the status for a topic that was subscribed to has changed.

Parameters
connectorThe connector.
topicNameThe name of the topic on which the status has changed.
statusTypeThe topic status change type.

Implements PushTechnology.DiffusionCore.Connection.Interfaces.IServerConnectionListener.

void PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.Start ( )

Start sending heartbeat messages at the given frequency.

void PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.Stop ( )

Stops the service.

Property Documentation

bool PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.AutoStop
getset

Determines whether the service should stop itself when it detects that the Diffusion server has closed. Otherwise, the service should be stopped manually.

int PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.Count
getset

Get/set the number of ping messages to send.

int PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.Frequency
getset

Get/set the frequency at which to send heartbeat messages.

int PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.InactivityPeriod
getset

Get/set the period of inactivity before the heartbeats restart.

bool PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.SendingMessages
getset

Is this service sending messages?

Event Documentation

EventHandler<PingServiceEventArgs> PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.OnPing

The event fired when a ping is sent.

EventHandler<EventArgs> PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.Started

The event fired when the ping service is started.

EventHandler<EventArgs> PushTechnology.DiffusionCore.Connection.Services.DiffusionPingService.Stopped

The event fired when the ping service is stopped.