very grateful for your patience and guidance :-)
But I am almost there to achieve except for the last step.
I did as expected.
Below are my lines of code (printf - for debugging purpose only)
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);
...
When I trace back my crash , below lines is what i find
#0 0x2ae978ac in ?? () from /lib/libc.so.6
#1 0x0002dd48 in websocket_data_push (conn=0x9d7bc, ev=MG_POLL) at
common/jsonParser.cpp:15
#2 0x0002838c in iter2 (nc=0x96c70, ev=NS_POLL, param=0x2b873c80) at
common/mongoose.c:4999
#3 0x00018a40 in ns_iterate (server=0x8cd38, cb=0x282f4 <iter2>,
param=0x2b873c80) at common/mongoose.c:1009
#4 0x00018588 in ns_server_poll (server=0x8cd38, milli=100) at
common/mongoose.c:901
#5 0x00026ec4 in mg_poll_server (server=0x8cd38, milliseconds=100) at
common/mongoose.c:4558
#6 0x0002d494 in pollingFunction () at main.cpp:587
#7 0x2ab39a04 in start_thread () from /lib/libpthread.so.0
#8 0x2ab39a04 in start_thread () from /lib/libpthread.so.0
Could you suggest why does is crash ? I am clueless :-(
--
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.