how to browse only two (or all) service types

View: New views
5 Messages — Rating Filter:   Alert me  

how to browse only two (or all) service types

by Ali Mazhar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Hi,

I am writing a Qt application and I need to display data related to "_workstation._tcp" and "_vlc_http._tcp" service types only. Is it possible to achieve this using one browser object? If this is not possible then how can I browse for all service types using one browser object i.e what to send in the 4th argument of "avahi_service_browser_new()" function?

Any quick help will be highly appreciated.

BR, AM

_________________________________________________________________
Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: how to browse only two (or all) service types

by Trent Lloyd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ali,

On 31/07/2009, at 3:39 PM, Ali Mazhar wrote:

>
>
> Hi,
>
> I am writing a Qt application and I need to display data related to  
> "_workstation._tcp" and "_vlc_http._tcp" service types only. Is it  
> possible to achieve this using one browser object? If this is not  
> possible then how can I browse for all service types using one  
> browser object i.e what to send in the 4th argument of  
> "avahi_service_browser_new()" function?

A browser is for a given service type.. so you will need to  
instantiate two if you wish to lookup both workstation and vlc services.

Is there a reason you are looking up workstation services? This will  
typically be pretty noisy as everyone advertises them.

Thanks,
Trent

>
> Any quick help will be highly appreciated.
>
> BR, AM
>
> _________________________________________________________________
> Windows Live™ Hotmail®: Celebrate the moment with your favorite  
> sports pics. Check it out.
> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports
> _______________________________________________
> avahi mailing list
> avahi@...
> http://lists.freedesktop.org/mailman/listinfo/avahi
>

_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: how to browse only two (or all) service types

by Ali Mazhar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Trent,

Thanks for the info. My application is for a mesh network and therefore I need to see all the workstations which are in the same network just like on line users in a messenger!
Btw, how is it possible to remove a published service, e.g. multicast, from avahi without restarting the daemon. Actually, my application simply publishes a multicast stream port using "avahi-publish" and then start VLC application but when VLC is closed the multicast stops but service still remains in avahi daemon unless I restart it which naturally brings down my avahi browse application. Any tips?

BR, Ali


----------------------------------------

> From: lathiat@...
> To: avahi@...
> Date: Fri, 31 Jul 2009 16:05:45 +0800
> Subject: Re: [avahi] how to browse only two (or all) service types
>
> Hi Ali,
>
> On 31/07/2009, at 3:39 PM, Ali Mazhar wrote:
>
>>
>>
>> Hi,
>>
>> I am writing a Qt application and I need to display data related to
>> "_workstation._tcp" and "_vlc_http._tcp" service types only. Is it
>> possible to achieve this using one browser object? If this is not
>> possible then how can I browse for all service types using one
>> browser object i.e what to send in the 4th argument of
>> "avahi_service_browser_new()" function?
>
> A browser is for a given service type.. so you will need to
> instantiate two if you wish to lookup both workstation and vlc services.
>
> Is there a reason you are looking up workstation services? This will
> typically be pretty noisy as everyone advertises them.
>
> Thanks,
> Trent
>
>>
>> Any quick help will be highly appreciated.
>>
>> BR, AM
>>
>> _________________________________________________________________
>> Windows Live™ Hotmail®: Celebrate the moment with your favorite
>> sports pics. Check it out.
>> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports
>> _______________________________________________
>> avahi mailing list
>> avahi@...
>> http://lists.freedesktop.org/mailman/listinfo/avahi
>>
>
> _______________________________________________
> avahi mailing list
> avahi@...
> http://lists.freedesktop.org/mailman/listinfo/avahi

_________________________________________________________________
NEW mobile Hotmail. Optimized for YOUR phone.  Click here.
http://windowslive.com/Mobile?ocid=TXT_TAGLM_WL_CS_MB_new_hotmail_072009
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: how to browse only two (or all) service types

by Trent Lloyd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ali,

On 31/07/2009, at 5:39 PM, Ali Mazhar wrote:

>
> Hi Trent,
>
> Thanks for the info. My application is for a mesh network and  
> therefore I need to see all the workstations which are in the same  
> network just like on line users in a messenger!

Rather than use _workstation for this you'd probably be better off  
registering your own service.  This way you can pass on states (like  
online/away/etc) and other useful info .. plus you won't see users  
that aren't actually running your mesh software.

> Btw, how is it possible to remove a published service, e.g.  
> multicast, from avahi without restarting the daemon. Actually, my  
> application simply publishes a multicast stream port using "avahi-
> publish" and then start VLC application but when VLC is closed the  
> multicast stops but service still remains in avahi daemon unless I  
> restart it which naturally brings down my avahi browse application.  
> Any tips?

'avahi-publish' itself can be killed .. there is in no way a require  
to restart avahi-daemon.

to do this properly you would have to integrate support with VLC to  
publish/unpublish within VLC when it starts/stops - using /etc/avahi/
services/ or avahi-publish is a workaround to not having this  
available - but obviously not as nice in that it won't register/
unregister with the actual program.

Thanks,
Trent
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: how to browse only two (or all) service types

by Lennart Poettering-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 31.07.09 09:39, Ali Mazhar (ali_mzr@...) wrote:

>
>
> Hi Trent,
>
> Thanks for the info. My application is for a mesh network and
> therefore I need to see all the workstations which are in the same
> network just like on line users in a messenger!

You shouldn't be using _workstation for this. This service used to be
registered by some older MacOS versions and Avahi versions, too. But
we don't register it anymore by default. And it's not exactly clear
what this service stands for but it certainly doesn't stand for what I
used to think it stands for and I doubt it stands for what you think
it stands for either.

> Btw, how is it possible to remove a published service,
> e.g. multicast, from avahi without restarting the daemon. Actually,
> my application simply publishes a multicast stream port using
> "avahi-publish" and then start VLC application but when VLC is
> closed the multicast stops but service still remains in avahi daemon
> unless I restart it which naturally brings down my avahi browse
> application. Any tips?

As Trent mentioned, just kill avahi-publish. Or
avahi_entry_group_free() if you use the C API.

Lennart

--
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi