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

#include <cPingClient.h>

Public Member Functions

 cPingClientQuery ()
 
virtual ~cPingClientQuery ()
 
void InitClientData ()
 
bool HasResponse () const
 
TIMESYSD_t CheckTimeLagMax ()
 
bool CheckPingTime (TIMESYS_t timeNow, TIMESYSD_t nTimeThrottle=cTimeSys::k_FREQ *10)
 
void OnRxEchoResp (TIMESYS_t timeSent)
 
virtual HRESULT OnPingRx (HRESULT hRes, const BYTE *pPayload, size_t nPayloadLen)
 

Public Attributes

cNetAddress m_AddrServer
 address of the server we are pinging. More...
 

Detailed Description

Track a clients attempts to ping a particular server. I'm expecting a response from this server. a client can track multiple servers. Can be used for TCP type pings as well.

Constructor & Destructor Documentation

◆ cPingClientQuery()

GrayLib::cPingClientQuery::cPingClientQuery ( )

◆ ~cPingClientQuery()

virtual GrayLib::cPingClientQuery::~cPingClientQuery ( )
inlinevirtual

Member Function Documentation

◆ CheckPingTime()

bool GrayLib::cPingClientQuery::CheckPingTime ( TIMESYS_t  timeNow,
TIMESYSD_t  nTimeThrottle = cTimeSys::k_FREQ * 10 
)

Don't send pings too fast! nTimeThrottle my send.

◆ CheckTimeLagMax()

TIMESYSD_t GrayLib::cPingClientQuery::CheckTimeLagMax ( )

How long since a valid response.

◆ HasResponse()

bool GrayLib::cPingClientQuery::HasResponse ( ) const

◆ InitClientData()

void GrayLib::cPingClientQuery::InitClientData ( )

◆ OnPingRx()

HRESULT GrayLib::cPingClientQuery::OnPingRx ( HRESULT  hRes,
const BYTE *  pPayload,
size_t  nPayloadLen 
)
virtual

Get My Ping byte packets back. (for this client to server connection)

Returns
IPingProtocol::MSGTYPE_TYPE

◆ OnRxEchoResp()

void GrayLib::cPingClientQuery::OnRxEchoResp ( TIMESYS_t  timeSent)

i got a response back from the server MSGTYPE_ECHO_REQ. calculate the lag/delay

Note
clear m_timeTxOldest in case of wrap.

Member Data Documentation

◆ m_AddrServer

cNetAddress GrayLib::cPingClientQuery::m_AddrServer

address of the server we are pinging.


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