I want to immplement a Mesh network(each peer can be client and also server) based on UDP and broadcast in Java. I am working on my local system and try to run multiple instance from one class. But I want to know is there any possibilies in java to run multiple console inside of the code and assign a port to each consol/terminal when they are runnig as a peer in the network?
I mean I want to run multiple consols by Java code and assign a port number to each one for communicating.
I have 2 arraylists to define the port numbers for sending and receiving.
Thanks for your help