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]> 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].
> 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.
>

-- 
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.

Reply via email to