MCPcopy Create free account
hub / github.com/defold/defold / IsSocketIPv6

Function IsSocketIPv6

engine/dlib/src/dlib/socket_win32.cpp:212–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 }
211
212 bool IsSocketIPv6(Socket socket)
213 {
214 WSAPROTOCOL_INFO ss = { 0 };
215 socklen_t sslen = sizeof(ss);
216 int result = getsockopt(socket, SOL_SOCKET, SO_PROTOCOL_INFO, (char*)&ss, (int*)&sslen);
217 if (result == 0)
218 {
219 return ss.iAddressFamily == AF_INET6;
220 }
221
222 dmLogError("Failed to retrieve address family (%d): %s",
223 NATIVETORESULT(DM_SOCKET_ERRNO),
224 ResultToString(NATIVETORESULT(DM_SOCKET_ERRNO)));
225 return false;
226 }
227
228 static int TypeToNative(Type type)
229 {

Callers 5

FindConnectionFunction · 0.70
AddMembershipFunction · 0.70
ServerThreadFunction · 0.50
TESTFunction · 0.50
TYPED_TESTFunction · 0.50

Calls 1

ResultToStringFunction · 0.70

Tested by 3

ServerThreadFunction · 0.40
TESTFunction · 0.40
TYPED_TESTFunction · 0.40