The socket of TCP(TLS), UDP, or HTTP(S).
The event type.
The callback function.
Optional
tag: anyA developer-defined value that will be passed to the callback function.
The network I/O callbacks are sent to Thing-App tasks asynchronously, which is generously OK. For example, a TCP client shall not start sending to peers until a callback with LibertasNetEvent.Ready} is received. Nevertheless, since our design encourages the reuse of sockets, it is a common practice to Libertas_NetClose a socket and then immediately Libertas_NetConnect it again. In that case, if the task subscribes the LibertasNetEvent.Closed event, the event will be received after the Libertas_NetConnect is made because it's asynchronous. So either do not subscribe to LibertasNetEvent.Closed event if the code uses the Close/Connect pattern, or make the Libertas_NetConnect call in the LibertasNetEvent.Closed handler. The LibertasNetEvent.Closed is guaranteed if there is an error or Libertas_NetClose is called.
Set the callback function for a specific network I/O event.