Libertas OS API Documentation
    Preparing search index...

    Function Libertas_NetConnect

    • Establish a plain TCP connection, or a TLS handshake.

      Parameters

      • fd: number

        A socket handle.

      • host: string

        Host name, e.g., example.com

      • port: number

        TCP port number.

      • Optionaltls: boolean

        If true, establish a TLS connection.

      Returns void

      The socket must be a new socket or an existing closed socket. A non-closed socket is not available to be reused. Calling on a non-closed socket will raise an error.

      If an error happens on a socket, the socket is automatically closed thus is ready for reuse.