Jump to content
chkaufmann

Find UDP Server

Recommended Posts

I have two applications that communicate in a LAN using UDP. Both applications have TIdUDPClient and a TIdUDPServer. Until now the user must configure the port and the IP address. Now I would like a solution where client computers "find each other" automatically. What is the best way to do that?

 

Regards
Christian

Share this post


Link to post

The "clean" way would be to use Bonjour a.k.a.  ZeroConf.

 

https://en.wikipedia.org/wiki/Zero-configuration_networking

 

It is a somewhat "standardized" way of announcing all sorts of services using UDP broadcasts.  Companies like Apple use it for discovering wireless devices such as printers.  A zeroconf  implementation can be found in the Remobjects suite ( https://docs.remotingsdk.com/Clients/Concepts/ROZeroConf/ )  but after some googling I found an open source implementation as well ( https://github.com/deltics/delphi.libs/tree/master/bonjour ).

 

 

 

 

 

  • Like 2

Share this post


Link to post
22 hours ago, A.M. Hoornweg said:

The "clean" way would be to use Bonjour a.k.a.  ZeroConf.

Too complex IMHO. Bonjour even requires DLL. But some concepts could be borrowed indeed

Share this post


Link to post

The disadvantage of all these broadcast methods is that they don't work across segmented LAN's.   And then there's the can of worms called IPv6.

Share this post


Link to post
2 hours ago, A.M. Hoornweg said:

The disadvantage of all these broadcast methods is that they don't work across segmented LAN's.  

If you want to cross segments, the you probably need a central broker,  like MQTT provides.

But I think the original thread request stay inside a local segment, where UDP would be an option.

Edited by Rollo62

Share this post


Link to post
3 hours ago, Fr0sT.Brutal said:

What's so terrible in IPv6?

Subnet broadcasting is supported only in IPv4, not in IPv6, you have to use multicasting instead.

Edited by Remy Lebeau
  • Thanks 1

Share this post


Link to post
3 hours ago, Remy Lebeau said:

Subnet broadcasting is supported only in IPv4, not in IPv6, you have to use multicasting instead.

..and boy, is that fun 🙄

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×