How to access request data (evdata) from a worker thread? #1682
-
I was able to run the multithreaded example, pretty straightforward, but I can't figure out how to access evdata from the thread in order to extract information from the request that the task would need to perform its work, something like this: struct mg_http_message *hm = (struct mg_http_message *) ev_data; The actual thread function only receives a socket: static void thread_function(void *param) Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
just |
Beta Was this translation helpful? Give feedback.
from the docs:
just
mg_send(c->fn_data, ...);
infn
andint n = recv(sock, buffer, sizeof(buffer), 0); // THIS WILL BLOCK
in your worker thread