[Development] QTBUG-10481: Adding support for DNS SRV lookups

André Somers andre at familiesomers.nl
Tue Nov 1 16:30:09 CET 2011


Hi,

On Tue, Nov 1, 2011 at 4:15 PM, Jeremy Lainé <jeremy.laine at m4x.org> wrote:

>
>
> While we are on the topic of the API, one thing which needs to be adressed
> is the kind of
> "handle" (if any) we return for asynchronous lookups:
>
> - QHostInfo::lookupHost() returns an integer
> - QDnsServiceInfo::lookupService() currently doesn't return anything
>
> If I recall correctly, Thiago was not happy with returning an integer,
> stating a "more
> modern API" should be used. Are we talking about replacing QDnsServiceInfo
> with a
> QDnsServiceReply* ? Pro: it's consistent with QNAM. Con: we place the
> burden of freeing
> memory on the user.
>
How about returning a QSharedPointer<QDnsServiceReply> then?
Pro: Using the right shared pointer immediately makes clear who is the
owner of the object in question. In this case: whoever holds on to the
pointer the longest.
Con: this is not currently used in Qt APIs.


Andre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20111101/422e71d3/attachment.html>


More information about the Development mailing list