[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
RE: [Libevent-users] Opaque data on callback?
Hi Harlan,
Perhaps I'm missing something but the callback for async dns is:
_lookup_response( int errCode, struct evutil_addrinfo* info, void* data )
Where the "data" member is what you pass into evdns_getaddrinfo and can be
anything you want. So, you already have a place to put your context don't
you?
KB
> I'm new to libevent...
>
> I'm writing an app that needs async DNS. While I have the core of this
> working, I have some "private data" that I want to associate with each
> name that is being looked up, so it would be Swell if the
> evutil_addrinfo was actually a structure that contained:
>
> - a void pointer for private data
> - a struct addrinfo
>
> so in my callback function I could use the private data pointer to
> easily and quickly access some context information about the answer I
> just got.
>
> Or something functionally equivalent.
>
> Suggestions?
> --
> Harlan Stenn <stenn@xxxxxxx>
> http://ntpforum.isc.org - be a member!
> ***********************************************************************
> To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
> unsubscribe libevent-users in the body.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.