lws_cancel_service() is the only safe choice on all platforms. If you are on Linux, you can try following the lws_callback_on_writable() with a lws_cancel_service() to force the main thread to wake and handle your change. For platform specific reasons, that won't work on, eg, BSD...
If it's from another thread, the recommended way is only to call cancel_service() and do any callback_on_writable() from the CANCELED callback in the lws service thread context. Besides, in this case, everything is happening quickly if it's localhost. So it shouldn't be to do with ...
intlws_service_timeout_check(struct lws *wsi,unsignedintsec){structlws_context_per_thread*pt= &wsi->context->pt[(int)wsi->tsi];structlws**pwsi;/* * if extensions want in on it (eg, we are a mux parent) * give them a chance to service child timeouts */if(lws_ext_cb_active(wsi...
开发者ID:reticentae,项目名称:libwebsockets,代码行数:18,代码来源:service.c 示例13: lws_plat_init ▲点赞 1▼ LWS_VISIBLEintlws_plat_init(struct lws_context *context,conststruct lws_context_creation_info *info){structlws_context_per_thread*pt= &context->pt[0];inti, n = context->count_thre...
} lws_service(context, 0); lwsl_err("%s: closing\n", __func__); for (n = 0; n < 2; n++) { uv_signal_stop(&signal_outer[n]); uv_close((uv_handle_t *)&signal_outer[n], NULL); } /* cancel the per-minute sul */ lws_sul_cancel(&sul_lwsws); lws_context_destroy(...