0

I have a client-server program using UDP and I would like to test the connection times in an automated way.

The server closes itself after accepting or rejecting a connection and I can't make changes to the connection related code not for the client, nor the server.

The only thing that comes to my mind is trying to do this from a batch file (I'm in windows), but I don't know if it is possible to run both commands from the same batch file in an automated way.

pepelu
  • 368
  • 1
  • 3
  • 18

1 Answers1

0

It happened to be easier than I thought, actually the problem was formulating the correct question: How to run multiple DOS commands in parallel?

For the sake of completeness, this is the script I'm using now.

@ECHO OFF
for /l %%i in (1, 1, 100) do (
    start server.exe
    ping 192.0.2.2 -n 1 -w 2 > nul
    start /wait client.exe
)

I start the server and give him 2ms to warm up (if not, some times the client would start up before the server and that instance will fail). Then I call the client and wait until it's finished.

Community
  • 1
  • 1
pepelu
  • 368
  • 1
  • 3
  • 18