The prepare_nsapi_thread function enables threads that are not created by the server to act like server-created threads. This function must be called before any NSAPI functions are called from a thread that is not server-created.
void prepare_nsapi_thread(Request *rq, Session *sn);
Request *rq is the request.
Session *sn is the session.
The Request and Session parameters are the same parameter as the ones passed into your SAF.