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. This is generously OK. For example, a TCP client shall not start to send to peers until a callback with LibertasNetEvent.Ready is received. Nevertheless, since our design encourages reuse the sockets. It is a common practice to Libertas_NetClose a socket then immediate Libertas_NetConnect 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. This will cause confusion. 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.