I have multiple pc's in a network, they each need to get each other ipaddress, i looked at broadcasting, but this requiers a server, but all pc's need to find all other. can anyone kick me in the right direction on how this could be implemented?

有帮助吗?

解决方案

Well a server is technically a client that just listen for connection most of the time or provides a service.

Now, if you want that all client should discover each other. The simple way to achieve that would be send Listen for Broadcast Message at a specific port and send a broadcast message in the network that will help other client know that a EndPoint (Node) is now active.

An example would be

  1. Listen on port XXXX as client starts up.
  2. Broadcast a message at port XXXX this will help other client discover the node.
  3. Once the client receives a discovery message, it sends its own detail to the client from which it received the message!
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top