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::cPingServer Class Reference

#include <cPingServer.h>

Inheritance diagram for GrayLib::cPingServer:
GrayLib::cPingCommon

Public Member Functions

 cPingServer (const IPingProtocol *pForm)
 
virtual ~cPingServer ()
 
virtual UINT32 get_PingStatusCode () const
 
void put_PingStatusCode (UINT32 dwStatusCode)
 
virtual cStringA get_PingInfo () const
 
void put_PingInfo (cStringA s)
 
virtual HRESULT onTickPing (OUT BYTE *pPayload, OUT size_t &nPayloadLen, OUT cNetAddress &SockAddr) override
 
HRESULT onTickPingSimple ()
 
 UNITTEST_FRIEND (cPingServer)
 
- Public Member Functions inherited from GrayLib::cPingCommon
 cPingCommon (const IPingProtocol *pForm)
 
virtual ~cPingCommon ()
 
HRESULT OpenPing (const cNetAddress &AddrListen, bool bICMP=false)
 
void ClosePing ()
 

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

Listen for UDP incoming pings and respond. UDP pinging. Also used for firewall testing. Clients are non-persisted/connectionless. Maybe use cNetAddrTracker to track past clients.

Constructor & Destructor Documentation

◆ cPingServer()

GrayLib::cPingServer::cPingServer ( const IPingProtocol pForm)

◆ ~cPingServer()

GrayLib::cPingServer::~cPingServer ( )
virtual

Member Function Documentation

◆ get_PingInfo()

virtual cStringA GrayLib::cPingServer::get_PingInfo ( ) const
inlinevirtual

get a status string for use of MSGTYPE_INFO_REQ.

Note
override this for more info in ping reply.

◆ get_PingStatusCode()

virtual UINT32 GrayLib::cPingServer::get_PingStatusCode ( ) const
inlinevirtual

get status code for use of MSGTYPE_STATUS_REQ

just return the stored code. (or override this)

◆ onTickPing()

HRESULT GrayLib::cPingServer::onTickPing ( OUT BYTE *  pPayload,
OUT size_t &  nPayloadLen,
OUT cNetAddress SockAddr 
)
overridevirtual

Poll for an incoming Ping Packet and respond to it if possible.

Returns
0 = got nothing. <0 = Error MSGTYPE_TYPE Packet Message Type.

Reimplemented from GrayLib::cPingCommon.

◆ onTickPingSimple()

HRESULT GrayLib::cPingServer::onTickPingSimple ( )

Check for incoming pings. default (simple) UDP implementation. most basic response to a ping.

◆ put_PingInfo()

void GrayLib::cPingServer::put_PingInfo ( cStringA  s)
inline

set info for use of MSGTYPE_INFO_REQ. Server must update this.

◆ put_PingStatusCode()

void GrayLib::cPingServer::put_PingStatusCode ( UINT32  dwStatusCode)
inline

set status code for use of MSGTYPE_STATUS_REQ. Server must update this.

just return the stored code. (or override this)

◆ UNITTEST_FRIEND()

GrayLib::cPingServer::UNITTEST_FRIEND ( cPingServer  )

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