Closed clearday4 closed 2 years ago
I will try some times later.
Have you tried this ? Is multi-threading OK just adding the two data to wsclient_t ?
I will try some times later.
Have you tried this ? Is multi-threading OK just adding the two data to wsclient_t ?
yes, it works. The important point is to use lws_context and interrupted separately for each api call.
The important point is to use lws_context and interrupted separately for each api call.
Do you have a sample code ?
Or could you please submit a PR to deliver this change ?
Use wsc->context instead of g_lws_context, and wsc->interrupted instead of g_interrupted.
wsc->context is created and destroyed in wsclient_run()
#ifdef CONFIG_CP_MULTI_THREAD
wsc->context = lws_create_context(&info);
if (!wsc->context) {
lwsl_err("%s: wsclient init failed.\n", __func__);
return 1;
}
/* schedule the first client connection attempt to happen immediately */
lws_sul_schedule(wsc->context, 0, &wsc->sul, connect_client, 1);
#else
g_lws_context = lws_create_context(&info);
if (!g_lws_context) {
lwsl_err("%s: wsclient init failed.\n", __func__);
return 1;
}
/* schedule the first client connection attempt to happen immediately */
lws_sul_schedule(g_lws_context, 0, &wsc->sul, connect_client, 1);
#endif
...
...
...
#ifdef CONFIG_CP_MULTI_THREAD
lws_context_destroy(wsc->context);
wsc->interrupted = false;
#else
lws_context_destroy(g_lws_context);
g_interrupted = false;
#endif
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closing this issue.
Could you put *g_lws_context and g_interrupted into the wsclient_t structure?