Socket_connect

Function Socket_connect 

Source
pub unsafe extern "C" fn Socket_connect(
    self_: Socket,
    address: *const c_char,
    port: c_int,
) -> bool
Expand description

connect to a server

Connect to a server application identified by the address and port parameter.

The “address” parameter may either be a hostname or an IP address. The IP address has to be provided as a C string (e.g. “10.0.2.1”).

Implementation of this function is MANDATORY if client functionality is required.

NOTE: return type changed from int to bool with version 0.8

§Arguments

  • self - the client socket instance
  • address - the IP address or hostname as C string
  • port - the TCP port of the application to connect to

§Returns

true if the connection was established successfully, false otherwise