0

I got two programs that need to communicate using tcp/ip the problem is that both of them will have a dynamic IP which will always change during runtime. The simple solution is to insert a kind of server in between which will contain a list of connected clients and it'll make sure to route the packets to the correct client.

My question is, are there other methods to implement it without having a server between the clients or using a dynamic DNS provider ?

Thanks.

user1005448
  • 617
  • 3
  • 12
  • 22
  • When new client connects to your server then simply store its IP address. Your server is a directory of _known IP addresses_. Each client will then connect directly with each other. However: for the client that will accept an incoming connection you need to have the TCP port open (and properly routed). – Adriano Repetti Sep 14 '15 at 10:38
  • If the 2 machines reside one the same IP subnet (broadcast domain), you can have them discover eachother using broadcast or multicast. (Even if they're not on the same subnet, you could use multicast, but that requires configuration of every router inbetween your two machines.) – nos Sep 14 '15 at 10:42
  • Does it mean that IP changes during runtime but the DNS host name remains the same? – Vojtěch Dohnal Sep 14 '15 at 10:42

1 Answers1

0

Even if you decided to use a dynamic DNS provider, that would mean you have to announce the IP anyway. I myself would have a server in the middle which can take announcements and serve a list of those announcements to any clients that decide to ask for it.

Frement
  • 756
  • 5
  • 10