MCPcopy Create free account
hub / github.com/3rdparty/libprocess / peer

Function peer

include/process/network.hpp:98–108  ·  view source on GitHub ↗

* Returns the peer's `Address` for the accepted or connected socket. * * @return An `Address` or an error if the `getpeername` system call * fails or the family type is not supported. */

Source from the content-addressed store, hash-verified

96 * fails or the family type is not supported.
97 */
98inline Try<Address> peer(int_fd s)
99{
100 sockaddr_storage storage;
101 socklen_t length = sizeof(storage);
102
103 if (::getpeername(s, (sockaddr*)&storage, &length) < 0) {
104 return ErrnoError("Failed to getpeername");
105 }
106
107 return Address::create(storage);
108}
109
110} // namespace network {
111} // namespace process {

Callers 2

peerMethod · 0.85
accept_SSL_callbackMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected