Zeroconfig / Bonjour

If you think LogMX needs a new useful feature!
Post Reply
jobemakar
Posts: 27
Joined: Thu Jun 11, 2015 9:49 pm

Zeroconfig / Bonjour

Post by jobemakar »

Hi - this isn't a serious request. More of a "wouldn't it be cool if LogMX did this" kind of thing. I use LogMX in many ways. But here is one use case that I have.

* LogMX is running on my PC and listening using either my custom TCP manager or the HTTP/S managers.
* My client app (which is what I log from) is running on a mobile device on my network.
* My client app can easily log to LogMX over the network, but it doesn't know the internal hostname/IP or port to use to do so. (Hard coding it isn't a good option because we have a team...so many networks and PCs.)

What I've done is created a simple zeroconfig app that runs on my PC where I enter my LogMX settings. And, I implemented zeroconfig protocol in my client app. Because of that, my client can fire off a multicast request blindly to the network looking for a service (LogMX service in this case). My little zeroconfig app on my desktop hears this and responds with the details. My mobile app now has the connection information it needs.

In the case where the network has many LogMX's running on many PCs and they all respond, my mobile app displays a list of PC names and the developer just needs to tap on the one they want to use. We then cache that PC name (not the IP) so that we can just auto-choose that in future sessions.

Zeroconfig / Bonjour / MDNS /(or whatever the real name of this feature is) definitely has a bit of a learning curve. But there are libraries out there that implement all of the complexity for you. So if you decided this was worthwhile to add it probably won't be too terrible.

If you add it you might consider making it an optional *addition* to any manager that listens rather than polls. So TCP, HTTP, HTTPS.
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: Zeroconfig / Bonjour

Post by admin »

Hello,

Thank you for this idea, very interesting. It seems there a few different implementations of zeroconfig (Apple's implementation "Bonjour" seems indeed pretty famous). I just only read a couple of things on this topic and it seems one implementation is not compatible with another (eg. client using X and server using Y). So it would mean client apps would have to use the implementation used by LogMX.

I would be curious to know which implementation you used in your client app and in your "server" app running beside LogMX. And also, which library did you use?

I think we could add this feature in LogMX, especially if we can make it easy to use for everyone.

Thank you,
Xavier
jobemakar
Posts: 27
Joined: Thu Jun 11, 2015 9:49 pm

Re: Zeroconfig / Bonjour

Post by jobemakar »

I used a Bonjour DLL in a C# app that runs on my PC. This is the 'server' if you will.

The client code I put together isn't necessarily Bonjour. There was no library that already exists that would run within Unity (.Net 3.5). So I got something working by writing some of my own code and ripping some useful stuff out of an API that works in .Net 4.5+. This contains some of the code I used in the client: https://github.com/tmds/Tmds.MDns

The 'server' uses a DLL called Interop.Bonjour.dll. Someone else found that for me a year or two back and I'm honestly not sure where it came from.

But I can tell you that the 'server' side is Bonjour and requires my PC to be running the Bonjour service. (Which you can download separately or I think it may install as part of iTunes). *And* my custom code seems to talk to it just fine without it needing anything bonjour related. Although, perhaps I'm just not making use of some features that Bonjour offers. What I've done is nothing more than a service request to the network, and get a response.

Sorry if this is confusing. I'm just familiar enough to have gotten it working. Not an expert by any means.
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: Zeroconfig / Bonjour

Post by admin »

Thank you, I see. The LogMX Java code could call the functions of a similar DLL, but that wouldn't be portable for macOS/Linux, as well as the requirement to run a Windows service. We will try to find a pure-Java solution so that the features provided by both your service and your DLL could be achieved on all OSes, after all it seems it's mainly just broadcast, which seems pretty easy in Java (https://docs.oracle.com/javase/tutorial ... sting.html) so finding or writing such a library should be feasible.

Thank you again for the idea, we will let you know as soon as we have updates on this topic.
Post Reply