MCPcopy Create free account
hub / github.com/Tencent/phxpaxos / getAddressLength

Method getAddressLength

src/utils/socket.cpp:139–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139socklen_t SocketAddress::getAddressLength(const Addr& addr) {
140 if (addr.addr.sa_family == AF_INET) {
141 return sizeof(addr.in);
142 } else if (addr.addr.sa_family == AF_UNIX || addr.addr.sa_family == AF_LOCAL) {
143 return sizeof(addr.un);
144 }
145 return sizeof(addr);
146}
147
148string SocketAddress::getHost() const {
149 if (_addr.addr.sa_family == AF_UNIX || _addr.addr.sa_family == AF_LOCAL) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected