MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / getChannelInfo

Method getChannelInfo

engine/Poseidon/Network/Legacy/NetApi.cpp:95–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93#ifdef NET_LOG
94
95char* NetChannel::getChannelInfo(char* buf) const
96{
97 NET_ERROR(buf);
98 struct sockaddr_in local;
99 if (peer)
100 peer->getLocalAddress(local);
101 else
102 Zero(local);
103 struct sockaddr_in distant;
104 getDistantAddress(distant);
105 snprintf(buf, sizeof(buf), "%u.%u.%u.%u:%u <-> %u.%u.%u.%u:%u", (unsigned)IP4(local), (unsigned)IP3(local),
106 (unsigned)IP2(local), (unsigned)IP1(local), (unsigned)PORT(local), (unsigned)IP4(distant),
107 (unsigned)IP3(distant), (unsigned)IP2(distant), (unsigned)IP1(distant), (unsigned)PORT(distant));
108 return buf;
109}
110
111unsigned NetChannel::getChannelId() const
112{

Callers

nothing calls this directly

Calls 1

getLocalAddressMethod · 0.80

Tested by

no test coverage detected