Hi, I am curious, if the callback function you pass to
mg_wakeup_server_ex() is called on every connection pointer that mongoose
is holding, then how do you make sure the response you want to send goes to
the correct connection?
Thanks,
Scott
On Monday, July 21, 2014 3:32:48 AM UTC-6, Sergey Lyubka wrote:
>
> What stops you from checking the URI of the connection?
>
>
> static int callback1(struct mg_connection *conn, enum mg_event ev) {
> if (strcmp(conn->uri, "/specific_uri") == 0 && conn->is_websocket) {
> mg_websocket_printf(conn, WEBSOCKET_OPCODE_TEXT, "%s",
> (const char *) conn->callback_param);
> }
> return MG_TRUE;
> }
>
> ...
> mg_wakeup_server_ex(server, callback1, "my message");
> ...
>
>
> On Mon, Jul 21, 2014 at 10:01 AM, swati joshi <[email protected]
> <javascript:>> wrote:
>
>> Hi,
>>
>> Thank you for that valuable input.
>> However, when i implement this, my functionality is not as expected. This
>> is because I need to send data to the connection with a specific uri.
>> I Tried using connection_param and callback_param to check the connection
>> with the specified uri [ (const char* )connection_param]. Still not able to
>> achieve.
>> Could you please redirect me !!
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/mongoose-users.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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.