Libertas OS API Documentation
    Preparing search index...

    Function Libertas_NetConnectDevice

    • Connect to a LAN device.

      Parameters

      • fd: number

        A socket handle.

      • device: number

        The LAN device.

      • port: number

        A port number.

      • Optionaltls: boolean

        If true, establish a TLS connection.

      Returns void

      A LAN device in local LAN can be detected through nDNS or uPNP. Because the IP of LAN device may change due to DHCP, Libertas Hub will keep tracking the actual IP address of each LAN device.

      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.