Ticket #65 (closed enhancement: fixed)
API documentation for avahi_client_new
| Reported by: | jkyro | Owned by: | lennart |
|---|---|---|---|
| Milestone: | Avahi 0.6.17 | Component: | docs |
| Keywords: | Cc: |
Description
The API documentation doesn't tell that the avahi_client_new function also calls the callback provided as parameter.
The expression is "whenever the client state changes", but there's no mention about the creation of the client itself generating a state change that gets handled before the function actually returns. This has the implication that the value stored from avahi_client_new can't be used in the callback.
In my opinion, I'm not expecting the callback to be called until entering the event loop unless stated otherwise.
Example:
static AvahiClient *global_client = NULL;
void my_client_callbcak( AvahiClient *client, AvahiClientState s, void *userdata)
{
//global_client is NULL the first time this function is called
...
}
int main()
{
global_client = avahi_client_new();
}
Change History
Note: See
TracTickets for help on using
tickets.
