No subject


Tue Dec 28 02:14:36 MSK 2010


---------------
An application initializes resolver context, submits any number of
queries for it using one of supplied dns_submit_XXX() routines (each
return the query identifier as pointer to query structure), waits for
input on the UDP socket used by the library, and gives some control to
the library by calling dns_ioevent() and dns_timeouts() routines when
appropriate. The library performs all necessary processing and
executes application supplied callback routine when a query completes
(either successefully or not), giving it the result if any, pointer to
the resolver context (from which completion status may be obtained),
and the data pointer supplied by an application when the query has
been submitted.
---------------

First of all, in my case dns_submit_a4() returns 0:

---------------
  size_t query_ptr;

  if (query_ptr =3D dns_submit_a4(dns_context, "google.com", 0,
dns_res_A_cb, NULL) =3D=3D 0) {
    fprintf(stderr, "FATAL: unable to submit query: %s\n",
dns_strerror(dns_status(0)));
    return 1;
  }
  printf("query_ptr =3D <%lu>\n", (unsigned long)query_ptr);
--------------

Running it I get: "query_ptr =3D <0>". Shouldn't it be a pointer?

Perhaps should I use the data pointer provided in the dns_submit_a4()
call as last parameter to match the callback? But that would mean
before the query I must create a "random" identifier, set it as 'data'
parameter in dns_submit_a4(), and check 'data' when a callback is
executed.

Do I miss something?

Thanks a lot.

--=20
I=C3=B1aki Baz Castillo
<ibc at aliax.net>


More information about the udns mailing list