AutoDiscovery on Linux with XOJO

Greetings,

I have few linux boxes with Debian on them and I’m looking for an option to be able to discover them in the network and eventually to be able to configure few basic things on them via an admin app that will be on a Mac.

First thing will be to have a way to use auto discovery on the linux in a console app that will act as a server.

So far on the examples in XOJO there is an app doing that but only for desktop apps so linux and console nothing . I was thinking as well to have a simple interface as well so another option to have a Web App but I guess is same thing in the end.

So Target Platform Linux ; ConsoleApp and/or WebApp

Any ideas are more than accepted.

Thanks in advance .

You may prefer to use avahi library on Linux to use standard zeroconf service detection.

See
http://www.monkeybreadsoftware.net/pluginpart-avahi.shtml

If you only need to find Xojo apps the Auto discovery will of course be enough.

[quote=384942:@Christian Schmitz]You may prefer to use avahi library on Linux to use standard zeroconf service detection.

See
http://www.monkeybreadsoftware.net/pluginpart-avahi.shtml

If you only need to find Xojo apps the Auto discovery will of course be enough.[/quote]
Thanks Christian, Is there a sample project where I can do some test and see that it is working ? or could you do a small example ? what I just need from the client desktop app is to send me the machine name and the ip , source code will be great.

Thanks

For AutoDiscovery, check the examples coming with Xojo.
For the plugin Classe, please check the example coming with the plugin download.

Thanks Christian, so I guess I have to install avahi or those will handle all ?

Thanks

libavahi is a package on your linux distribution which you can install there.

Any idea how to properly install. that ? or it depends on any specific library ?

I compiled the Bonjour console and run it and I get this [quote]/opt/SyAdmin# ./SyAdmin
This application does registering a service, browse and lookup this service.
Press control-C to quit.
No Bonjour found!
[/quote]

thanks

I did

sudo apt-get update sudo apt-get install libavahi-compat-libdnssd1 apt-get install avahi-daemon avahi-discover libnss-mdns

but still the same thing after running the app

Well despite that error that No Bonjour found it works ok I see, thanks

[quote=384953:@Christian Schmitz]For AutoDiscovery, check the examples coming with Xojo.
For the plugin Classe, please check the example coming with the plugin download.[/quote]
Question,

In the [quote]Find computer[/quote] sample, I run it and I have in the list box 4 times the same information, is it possible to check if the info already exists not to publish again and to show one for each ip ?

I have the same box with Apple File Sharing service 4 times.

In [quote] MyAddrInfo[/quote] under [code]Sub ServiceAddrInfo(Flags as integer, InterfaceIndex as integer, ErrorCode as integer, AddressFamily as Integer, IP as string, SockAddr as MemoryBlock, HostName as string, ttl as Integer) Handles ServiceAddrInfo

if not IPs.HasKey(IP) then
// avoid duplicates

dim l as listbox = Window1.List
l.addrow name
l.Cell(l.LastIndex,1)=IP+":"+str(port)
l.Cell(l.LastIndex,2)=HostName
l.Cell(l.LastIndex,3)=reason

IPS.Value(IP) = nil

end if

done = (BitwiseAnd(flags, me.kFlagsMoreComing) = 0)

End Sub
[/code]

You do have something to avoid duplicates but it seems that it is not workin. I still have same ip same service 4 times.

Thanks

Well, you can debug it, but maybe the IPs are not the same?

yeap I’ll try to do that in 2017 , 2018 is broken on that part .