Hi,

I have two queries​


[1]
ev_handler(conn, ev)
{
    if (ev == MG_REQUEST) {
       result = req_hdlr()
    } else if (ev == MG_AUTH) {
       result = auth_hdlr()
    } if (ev == MG_POLL) {
       result = poll_hdlr()
    }

     return result;
}

How can I check whether the connection is a new connection or the same 
connection is calling ev_handler() multiple times (may be because we 
returned MG_MORE in last call)?
     

[2]
I am working with async request calls. I can have multiple such concurrent 
requests. How can I embed my context in mongoose "conn", so that I can 
recognize (in poll_hdlr()) which of my request is completed?

ev_handler(conn, ev)
{
    void *my_ctx = ...;

    if (ev == MG_REQUEST) {
       result = req_hdlr()

    } else if (ev == MG_AUTH) {
       result = auth_hdlr()

    } if (ev == MG_POLL) {

       if (new connection) {
           embed my_ctx in conn;
       } else if ((old connection) && (work is done)) {
            retrieve my_ctx from conn and work on it;
            return MG_TRUE;
       }

       result = poll_hdlr()
    }
}

Regards,
~Puneet

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