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

Function IsSocketIPv4

engine/dlib/src/dlib/socket_win32.cpp:196–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194 }
195
196 bool IsSocketIPv4(Socket socket)
197 {
198 WSAPROTOCOL_INFO ss = { 0 };
199 socklen_t sslen = sizeof(ss);
200 int result = getsockopt(socket, SOL_SOCKET, SO_PROTOCOL_INFO, (char*)&ss, (int*)&sslen);
201 if (result == 0)
202 {
203 return ss.iAddressFamily == AF_INET;
204 }
205 dmLogError("Failed to retrieve address family (%d): %s",
206 NATIVETORESULT(DM_SOCKET_ERRNO),
207 ResultToString(NATIVETORESULT(DM_SOCKET_ERRNO)));
208
209 return false;
210 }
211
212 bool IsSocketIPv6(Socket socket)
213 {

Callers 12

FindConnectionFunction · 0.70
AddMembershipFunction · 0.70
SetMulticastIfFunction · 0.70
AcceptFunction · 0.70
BindFunction · 0.70
ConnectFunction · 0.70
SendToFunction · 0.70
ReceiveFromFunction · 0.70
GetNameFunction · 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