MCPcopy Create free account
hub / github.com/Beckhoff/ADS / IsConnectedTo

Method IsConnectedTo

AdsLib/Sockets.cpp:291–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291bool TcpSocket::IsConnectedTo(const struct addrinfo *const targetAddresses) const
292{
293 for (auto rp = targetAddresses; rp; rp = rp->ai_next) {
294 if (m_SockAddress.ss_family == rp->ai_family) {
295 if (!memcmp(&m_SockAddress, rp->ai_addr,
296 std::min<size_t>(sizeof(m_SockAddress),
297 rp->ai_addrlen))) {
298 return true;
299 }
300 }
301 }
302 return false;
303}
304
305UdpSocket::UdpSocket(const struct addrinfo *const host)
306 : Socket(host, SOCK_DGRAM)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected