Search code examples
p2pmulticast

How can I set up an simulate environment for p2p share program in a single laptop?


all!

Now I'm working on a p2p file share program in LAN(I use python). This program need to send multicast to other peers, and talks to others. But I have only one laptop, so how can I simulate two peers' communication in one computer. The peers use the same port and same multicast port


Solution

  • You can make each peer to use a different port!

    Pass the port number as a command line parameter, and if its not provided then default to the one you are using currently.

    This way when you can run in an environment with multiple machines you won't have to do anything additional, neither will your app users have to pass the port parameter.

    Alternatively you can use ModelNet.