IPSocket.connect

Connects this socket the specified address and port. This socket needs to have been created by socket().

  1. int connect(InAddr remote_address)
  2. int connect(cstring remote_ip_address, ushort remote_port)
    class IPSocket(bool IPv6 = false)
  3. int connect(sockaddr* remote_address)

Parameters

remote_ip_address cstring

remote IP address

remote_port ushort

remote port

Return Value

Type: int

0 on success or -1 on failure. On failure errno is set appropriately.

Errors: as above but also sets errno to EAFNOSUPPORT if the address does not contain a valid IP address string.

Meta