#include <cPingCommon.h>
|
static const size_t | k_SIZE_MAX = 1400 |
| max size for UDP PING_QTY type packets. include prefix, header and payload. More...
|
|
Base class shared by both cPingClient and cPingServer for UDP pinging
◆ cPingCommon()
◆ ~cPingCommon()
GrayLib::cPingCommon::~cPingCommon |
( |
| ) |
|
|
virtual |
◆ ClosePing()
void GrayLib::cPingCommon::ClosePing |
( |
| ) |
|
◆ onTickPing()
HRESULT GrayLib::cPingCommon::onTickPing |
( |
OUT BYTE * |
pPayload, |
|
|
OUT size_t & |
nPayloadLen, |
|
|
OUT cNetAddress & |
SockAddr |
|
) |
| |
|
virtual |
Call this periodically or on event to read incoming data. i am a client or server, check for new requests or getting a response back.
- Returns
- <0 = ERROR the message type i got. 0 = nothing. IPingProtocol::MSGTYPE_TYPE
Reimplemented in GrayLib::cPingServer.
◆ OpenPing()
HRESULT GrayLib::cPingCommon::OpenPing |
( |
const cNetAddress & |
AddrListen, |
|
|
bool |
bICMP = false |
|
) |
| |
Create a local UDP port for both tx and receive of replies. open some arbitrary UDP port for client to tx/rx on or server to rx/tx on. AddrListen.nFamily = AF_INET AddrListen.wPort= k_NET_PORT_INVALID = arbitrary local port UDP = SOCK_DGRAM, IPPROTO_UDP, m_pForm == cPingGray ICMP = SOCK_RAW, IPPROTO_ICMP, m_pForm == cPingICMP4
- Note
- the firewall needs to be open for this port to get UDP responses back! use cUPnPNAT ?
◆ k_SIZE_MAX
const size_t GrayLib::cPingCommon::k_SIZE_MAX = 1400 |
|
static |
max size for UDP PING_QTY type packets. include prefix, header and payload.
◆ m_pForm
What type of ping protocol are we ? Ping packet formatter.
◆ m_Socket
the UDP socket i listen and send on.
The documentation for this class was generated from the following files: