MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / getAddressFamily

Method getAddressFamily

Libraries/Socket/Socket.cpp:22–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#include "Internal/SocketServer.inl"
21
22SC::Result SC::SocketDescriptor::getAddressFamily(SocketFlags::AddressFamily& addressFamily) const
23{
24 struct sockaddr_in6 socketInfo;
25
26 socklen_t socketInfoLen = sizeof(socketInfo);
27 if (::getsockname(handle, reinterpret_cast<struct sockaddr*>(&socketInfo), &socketInfoLen) == SOCKET_ERROR)
28 {
29 return Result::Error("getsockname failed");
30 }
31 addressFamily = SocketFlags::AddressFamilyFromInt(socketInfo.sin6_family);
32 return Result(true);
33}

Callers 15

getMethod · 0.80
headMethod · 0.80
putMethod · 0.80
postMultipartMethod · 0.80
sendRawMethod · 0.80
socketClientServerMethod · 0.80
socketServerSnippetMethod · 0.80
createTCPSocketPairMethod · 0.80
createTCPServerMethod · 0.80

Calls 2

ErrorEnum · 0.50
ResultClass · 0.50

Tested by 15

getMethod · 0.64
headMethod · 0.64
putMethod · 0.64
postMultipartMethod · 0.64
sendRawMethod · 0.64
socketClientServerMethod · 0.64
socketServerSnippetMethod · 0.64
createTCPSocketPairMethod · 0.64
createTCPServerMethod · 0.64