Halyri - Häke  0.9
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
Hake_WPF.Network.Pinger Class Reference

Class for sending keepalive messages to server. More...

Public Member Functions

 Pinger (int interval, Connection connection)
 Creates the pinger. More...
 
void StartPinger ()
 Starts the pinger by creating a new timer and an event handler. Keepalive message interval is entered here. More...
 

Private Member Functions

void StopPinger ()
 Stops the pinger by removing the event handler. More...
 
async void SendKeepalive (object sender, EventArgs e)
 Sends the keepalive message on regular intervals. If the connection is lost, stops the pinger and shows a message box to user. More...
 

Private Attributes

int keepaliveIntervalSeconds
 
Connection connection
 
DispatcherTimer dispatcherTimer
 

Detailed Description

Class for sending keepalive messages to server.

<author>Ilkka Rautiainen</author>

Constructor & Destructor Documentation

Hake_WPF.Network.Pinger.Pinger ( int  interval,
Connection  connection 
)

Creates the pinger.

Parameters
intervalinterval of keepalive messages in seconds
connectionconnection

Member Function Documentation

async void Hake_WPF.Network.Pinger.SendKeepalive ( object  sender,
EventArgs  e 
)
private

Sends the keepalive message on regular intervals. If the connection is lost, stops the pinger and shows a message box to user.

void Hake_WPF.Network.Pinger.StartPinger ( )

Starts the pinger by creating a new timer and an event handler. Keepalive message interval is entered here.

void Hake_WPF.Network.Pinger.StopPinger ( )
private

Stops the pinger by removing the event handler.

Member Data Documentation

Connection Hake_WPF.Network.Pinger.connection
private
DispatcherTimer Hake_WPF.Network.Pinger.dispatcherTimer
private
int Hake_WPF.Network.Pinger.keepaliveIntervalSeconds
private

The documentation for this class was generated from the following file: