Socket_bind

Function Socket_bind 

Source
pub unsafe extern "C" fn Socket_bind(
    self_: Socket,
    srcAddress: *const c_char,
    srcPort: c_int,
) -> bool
Expand description

bind a socket to a particular IP address and port (for TcpSocket)

NOTE: Don’t use the socket when this functions returns false!

§Arguments

  • self - the client socket instance
  • srcAddress - the local IP address or hostname as C string
  • srcPort - the local TCP port to use. When < 1 the OS will chose the TCP port to use.

§Returns

true in case of success, false otherwise