[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-avahi
Subject: Re: [avahi] How to resolve only ipv4 addresses?
From: José Félix Ontañón <felixonta () gmail ! com>
Date: 2010-02-25 23:26:44
Message-ID: 369d2ff91002251526v7a105a3erac429bdf8f1ff46b () mail ! gmail ! com
[Download RAW message or body]
2010/2/21 <felixonta@gmail.com>:
> Hi Lennart, i really appreciate your help.
> You are right, it seems to be so simple solution that i must found it on the \
> documentation. I suppose i missed on first read.
> Cheers!
> ------Mensaje original------
> De: Lennart Poettering
> Remitente:avahi-bounces@lists.freedesktop.org
> Para:avahi@lists.freedesktop.org
> Responder a:Avahi ML
> Asunto: Re: [avahi] How to resolve only ipv4 addresses?
> Enviado: 21 Feb, 2010 20:41
>
> On Sun, 21.02.10 13:18, José Félix Ontañón (felixonta@gmail.com) wrote:
>
> > Hi everyone!
> >
> > I'm programming a python app that uses service discovering in what i think,
> > it's a very basic way:
> >
> > http://www.pastebin.com/f17ab27c1
> >
> > The fact it's that when i call resolve() sometimes an ipv6 address it's
> > returned. How can i force to only resolve ipv4 address?
>
> It sometimes helps reading the documentation:
>
> Replace this:
>
> def resolve(self, interface, protocol, name, stype, domain, flags=None):
> interface, protocol, name, stype, domain, host, aprotocol, address, \
> port, txt, flags = self.server.ResolveService(interface, protocol,
> name, stype, domain, avahi.PROTO_UNSPEC,
> dbus.UInt32(0))
>
> by this:
>
>
> def resolve(self, interface, protocol, name, stype, domain, flags=None):
> interface, protocol, name, stype, domain, host, aprotocol, address, \
> port, txt, flags = self.server.ResolveService(interface, protocol,
> name, stype, domain, avahi.PROTO_IPV4, dbus.UInt32(0))
>
> Have fun,
>
> Lennart
Sorry but i'm on avahi 0.6.25 (ubuntu karmic's default) and
avahi.PROTO_IPV4 doesn't exists. Need i a higher
version of avahi? Would avahi.PROTO_INET make the same effect? Is
there any good doc to learn about
the use and meaning of this constants?
Thanks.
> --
> Lennart Poettering Red Hat, Inc.
> lennart [at] poettering [dot] net
> http://0pointer.net/lennart/ GnuPG 0x1A015CC4
> _______________________________________________
> avahi mailing list
> avahi@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/avahi
>
>
> http://fontanon.org
--
http://fontanon.org
_______________________________________________
avahi mailing list
avahi@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/avahi
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic