Java sockets - how to simulate multiple clients

I have a socket program written in Java.

The server uses a DatagramSocket to create a socket with a specific port number. I have a Java client program that connects to this server and sends some messages.

I currently have 3 laptops, so I use 1 to start the server, and the remaining 2 are for clients. How can I simulate 100 clients?

I am thinking of writing a wrapper around clients and calling them 100 times, but the problem is that the ip address for the simulated clients is NOT unique. Any guidance is appreciated.

+4
source share
2 answers

, ip-

, , IP-. IP: , , DatagramSocket.getRemoteSocketAddress().

, 100 .

+2

All Articles