Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GrayLib::cPingLister Class Reference

#include <cPingLister.h>

Inheritance diagram for GrayLib::cPingLister:
GrayLib::cPingClient GrayLib::cPingCommon

Public Member Functions

 cPingLister ()
 
virtual ~cPingLister ()
 
HRESULT InitData (cStringA sData)
 
HRESULT PingSendLister (TIMESYSD_t nTimeThrottle=cTimeSys::k_FREQ *60 *60 *4)
 
HRESULT RequestLister (cStringA sPrefix, cStringA &sResponse)
 
 UNITTEST_FRIEND (cPingLister)
 
- Public Member Functions inherited from GrayLib::cPingClient
 cPingClient (const IPingProtocol *pForm)
 
virtual ~cPingClient ()
 
HRESULT PingSendGeneric (const cNetAddress &AddrServer, const BYTE *pData, size_t iLen)
 
HRESULT PingSendEcho (cPingClientQuery &server, TIMESYSD_t nTimeThrottle=cTimeSys::k_FREQ *10)
 
HRESULT onTickPingSimple (cPingClientQuery &server)
 
 UNITTEST_FRIEND (cPingClient)
 
- Public Member Functions inherited from GrayLib::cPingCommon
 cPingCommon (const IPingProtocol *pForm)
 
virtual ~cPingCommon ()
 
HRESULT OpenPing (const cNetAddress &AddrListen, bool bICMP=false)
 
void ClosePing ()
 
virtual HRESULT onTickPing (OUT BYTE *pPayload, OUT size_t &nPayloadLen, OUT cNetAddress &SockAddr)
 

Public Attributes

cNetAddrName m_AddrServer
 the hostname of the list server to be looked up via DNS. More...
 
cTimeSys m_timeSent
 Oldest time i sent and haven't yet gotten a response. More...
 
cStringA m_sData
 the payload data block for registration. (name="sdf",url="sdf",status=x,etc) More...
 
- Public Attributes inherited from GrayLib::cPingCommon
cNetSocket m_Socket
 the UDP socket i listen and send on. More...
 
const IPingProtocolm_pForm
 What type of ping protocol are we ? Ping packet formatter. More...
 

Static Public Attributes

static const NET_PORT_t k_PortDef = 2594
 port defined as 'Snap discovery'? NOT 'silverplatter' More...
 
static const char * k_pszAddrDef = "menasoft.asuscomm.com"
 
- Static Public Attributes inherited from GrayLib::cPingCommon
static const size_t k_SIZE_MAX = 1400
 max size for UDP PING_QTY type packets. include prefix, header and payload. More...
 

Detailed Description

periodically ping a lister service. tell it we are alive. throttle this to only once per X time period.

Constructor & Destructor Documentation

◆ cPingLister()

GrayLib::cPingLister::cPingLister ( )

Periodically register myself with the lister. calling PingSendLister()

◆ ~cPingLister()

GrayLib::cPingLister::~cPingLister ( )
virtual

Member Function Documentation

◆ InitData()

HRESULT GrayLib::cPingLister::InitData ( cStringA  sData)
  • sData = The string we send to register ourselves.

◆ PingSendLister()

HRESULT GrayLib::cPingLister::PingSendLister ( TIMESYSD_t  nTimeThrottle = cTimeSys::k_FREQ * 60 * 60 * 4)

calls MakePingPacket for data packet for registration. expect no response from this. UDP

send a UDP MSGTYPE_INFO_RESP datagram and expect no response from this. or maybe get MSGTYPE_STATUS_RESP back if OK?

  • sData = the data packet for registration.

◆ RequestLister()

HRESULT GrayLib::cPingLister::RequestLister ( cStringA  sPrefix,
cStringA sResponse 
)

open a TCP request to lister server machine. this includes error checking and acknowledgment from the server.

Returns
S_OK = full check
Note
blocking call. ASSUME: m_AddrServer has been set with the name of the list server.
TCP is better for dealing with firewalls and getting a response from the list server. Might we just get a UDP MSGTYPE_STATUS_RESP back from the list server ??

◆ UNITTEST_FRIEND()

GrayLib::cPingLister::UNITTEST_FRIEND ( cPingLister  )

Member Data Documentation

◆ k_PortDef

const NET_PORT_t GrayLib::cPingLister::k_PortDef = 2594
static

port defined as 'Snap discovery'? NOT 'silverplatter'

◆ k_pszAddrDef

const char * GrayLib::cPingLister::k_pszAddrDef = "menasoft.asuscomm.com"
static

◆ m_AddrServer

cNetAddrName GrayLib::cPingLister::m_AddrServer

the hostname of the list server to be looked up via DNS.

◆ m_sData

cStringA GrayLib::cPingLister::m_sData

the payload data block for registration. (name="sdf",url="sdf",status=x,etc)

◆ m_timeSent

cTimeSys GrayLib::cPingLister::m_timeSent

Oldest time i sent and haven't yet gotten a response.


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