Libertas OS API Documentation
    Preparing search index...

    Function Libertas_NetClose

    • Close the socket session.

      Parameters

      • fd: number

        The socket handle.

      Returns void

      Closed socket fd can be reused by initializing the session again. For connected sessions Libertas_NetConnect or Libertas_NetConnectDevice shall be called.

      The socket is automatically closed when an error happens. Once LibertasNetEvent.Error is received there is no need to call Libertas_NetClose() again.

      Libertas encourages reuse of the socket. Once the socket is closed, either by explicitly calling Libertas_NetClose or LibertasNetEvent.Error is received, the socket is available to be reused by calling Libertas_NetConnect on it.

      Also note that calling Libertas_NetConnect on a non-closed socket will raise an error.

      Call Libertas_NetDestroy to destroy the socket and release all resources.