Other Autodiscover the right local server

udg

Expert
Licensed User
Longtime User
Hi all,
I'd like to collect some hints and comments about a new project I'm thinking about.
It will be based on a few "servers" and several clients, all linked to the same WLAN. Each client has to autodiscover its own proper server (think of it as small clusters made by a server and a few clients).

Once a client is connected to its server, data will be exchanged for a whole workday, mainly commands and "objects" from server to client which should respond with ACK and locally collected data.
Any device in the project will be Android based

Actually I'm planning to follow the MQTT chat with autodiscovery example by Erel as the starting point.
Using the B4XSerializator object as a way to packet data between the endpoints.

Clients could be equipped with config files in order to be able to identify their servers.

What do you think? Am I missing some key point? Is there any other tutorial or valid code to study in order to plan the right solution for my project?

TIA
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Actually I'm planning to follow the MQTT chat with autodiscovery example by Erel as the starting point.
This is a good start. Send the sever "name" as part of the message. This will allow the clients to connect to the correct server.

Not all networks support broadcasting so make sure to also all manual entry.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Ok, thanks.
In this specific case I will be in control of the network, so I could easily allow broadcasting.
Another option I'm evaluating is that to assign fixed IPs to servers
And deploy security measures based on the features available.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is also another option which is to set one of the servers to be the main server. This server will have a static ip address and this server will manage the other servers.

This is more or less how B4i hosted builders work. The builders send their ip address to the main server. The clients connect to the main server, receive an ip of one of the builders and then connect to a builder. If a builder fails then it will be removed automatically from the main server after a few minutes (it depends on the type of failure).
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Good point.
This is approximately how I use what we call here a dispatcher. A client app calls a fixed server and receives back the IP/Port to use based on criteria like the app ID, geographic location (not yet used todate), etc.
Anyway, I've to postpone any decision based on what the prospect customer will tell me about the expected final configuration.

Thanks again
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
I will be in control of the network, so I could easily allow broadcasting
A minor detail: I'm also in control of my network, but my equipment just can't handle broadcasting so there's none of that happening here. Just wanted to make sure you understood that not all equipment will be able to broadcast, regardless of how much you want to allow it.

(And yes, this means that I manually edit the phone IP in the IDE when connecting from my workstation. Every. Single. Time. :confused:)
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Thank you for your hint. I'll pay greater attention when selected the equipment.
 
Upvote 0
Top