bind(2) wrapper. Equivalent to bind(m_socket, addr, addr_len). Code that uses this wrapper can be unit tested if this method is overridden by a mock Sock implementation.
Declared in <util/sock.h>
[[nodiscard]]
virtual
int
Bind(
sockaddr const* addr,
socklen_t addr_len) const;
0 on success, or -1 on error (with errno set).
The return value should not be discarded.
| Name | Description |
|---|---|
| addr | Address to bind the socket to. |
| addr_len | Size in bytes of the address pointed to by addr. |