Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cPingClient Class Reference

#include <cPingClient.h>

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

Public Member Functions

 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)
 

Additional Inherited Members

- 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 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

Send out a UDP or ICMP packet to some server.

Note
might be broadcast to discover network services? Can be pinging a number of servers. not just 1. can have many cPingClientQuery

Constructor & Destructor Documentation

◆ cPingClient()

GrayLib::cPingClient::cPingClient ( const IPingProtocol pForm)

◆ ~cPingClient()

GrayLib::cPingClient::~cPingClient ( )
virtual

Member Function Documentation

◆ onTickPingSimple()

HRESULT GrayLib::cPingClient::onTickPingSimple ( cPingClientQuery server)

get simple response to my ping. assumes tracking only one server. cPingClientQuery DONT use this if tracking multiple servers.

Returns
IPingProtocol::MSGTYPE_TYPE

◆ PingSendEcho()

HRESULT GrayLib::cPingClient::PingSendEcho ( cPingClientQuery server,
TIMESYSD_t  nTimeThrottle = cTimeSys::k_FREQ * 10 
)

Send out a MSGTYPE_ECHO_REQ. assume server will respond to this. expect response back on sending port. OpenPing() nTimeThrottle = only send this so often. don't overload the server.

Returns
S_FALSE = throttled. S_OK = sent.

◆ PingSendGeneric()

HRESULT GrayLib::cPingClient::PingSendGeneric ( const cNetAddress AddrServer,
const BYTE *  pData,
size_t  iLen 
)

Send out a generic UDP or ICMP blob of data as a request.

Note
rAddr.wPort = port of the server. expect any response on sending port.
Returns
S_OK = sent ping.

◆ UNITTEST_FRIEND()

GrayLib::cPingClient::UNITTEST_FRIEND ( cPingClient  )

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