Hi There,
Thanks a ton :-) the responses to this post has really made my life easy !!!
However, I have one doubt. What could be the possible reason for the call
back not getting called whenever mg_wakeup_server_ex() is called ?
This is essentially hanging my process, not allowing it to proceed to other
tasks.
In my case, below is the implementation and somehow the
websocket_data_push() -> callback is not getting called, making the process
hang.
To be specific, if i have 3 use cases, it works well for 2 use cases but
fails to call the callback in the 3rd case.
static int websocket_data_push(struct mg_connection *conn, enum mg_event ev)
{
printf("Inside websocket_data_push \n");
printf("URI %s \n" ,conn->uri);
printf("Sending Event %s \n" ,(char *) conn->callback_param);
if (ev == MG_POLL)
{
if (strcmp(conn->uri, "/web") == 0 && conn->is_websocket) {
printf("Sending Event %s \n" ,(char *) conn->callback_param);
mg_websocket_printf(conn, WEBSOCKET_OPCODE_TEXT, "%s",
(const char *) conn->callback_param);
}
}
return MG_TRUE;
}
...
mg_wakeup_server_ex(mgserver, websocket_data_push, "%lu %s",
(unsigned long) time(NULL), (const char *)
evString);
...
Please redirect.
--
You received this message because you are subscribed to the Google Groups
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.