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

Function address

include/process/network.hpp:79–89  ·  view source on GitHub ↗

* Returns the `Address` with the assigned ip and assigned port. * * @return An `Address` or an error if the `getsockname` system call * fails or the family type is not supported. */

Source from the content-addressed store, hash-verified

77 * fails or the family type is not supported.
78 */
79inline Try<Address> address(int_fd s)
80{
81 sockaddr_storage storage;
82 socklen_t length = sizeof(storage);
83
84 if (::getsockname(s, (sockaddr*)&storage, &length) < 0) {
85 return ErrnoError("Failed to getsockname");
86 }
87
88 return Address::create(storage);
89}
90
91
92/**

Callers 3

setup_serverMethod · 0.50
launch_clientMethod · 0.50

Calls

no outgoing calls

Tested by 3

setup_serverMethod · 0.40
launch_clientMethod · 0.40