47 sockaddr_in6 addrAnyIPV6 = {};
48 uint16_t portRecv = 0;
59 sockaddr_storage addrDummy;
67 addrAnyIPV6.sin6_family = AF_INET6;
84 sockaddr_in6 addr6 = {};
85 addr6.sin6_family = AF_INET6;
86 ::inet_pton(AF_INET6,
"::1", &(addr6.sin6_addr));
91 sockaddr_in addr4 = {};
92 addr4.sin_family = AF_INET;
93 ::inet_pton(AF_INET,
"127.0.0.1", &(addr4.sin_addr));
96 addrDestForSend.
SetPort(portRecv);
102 addrlength =
sizeof(addrDummy);
103 ret = ::recvfrom(socketRecv.
GetSocketHandle(), &ch,
sizeof(ch), MSG_DONTWAIT, (sockaddr*)&addrDummy, &addrlength);
socklen_t GetSockAddrLength() const
ssize_t recvfromex(int sockfd, void *buf, size_t len, int flags, CSocketAddress *pSrcAddr, CSocketAddress *pDstAddr)
int GetSocketHandle() const
const sockaddr * GetSockAddr() const
HRESULT EnablePktInfoOption(bool fEnable)
HRESULT UDPInit(const CSocketAddress &local, SocketRole role)
static HRESULT DoTest(bool fUseIPV6)
bool IsIPAddressZero() const
#define ChkIfA(expr, hrerror)
const CSocketAddress & GetLocalAddress() const