#!/usr/bin/perl -w use strict; die "syntax: $0 n_deployments n_mids_per_deployment" unless @ARGV == 2; my ($n_deployments, $n_mids_per_deployment) = @ARGV; $| = 1; use Benchmark; use IO::Socket; unless (fork()) { exec 'perl imip_hub 2345'; } sleep 1; for my $i (0..$n_deployments-1) { unless (fork()) { exec "perl imip_mux /tmp/imip_mux_$i.sock localhost 2345 $i c$i"; } } sleep 1; for my $i (0..$n_deployments-1) { unless (fork()) { exec "perl test_mid /tmp/imip_mux_$i.sock $n_deployments server"; } } sleep 1; for my $i (0..$n_deployments-1) { unless (fork()) { exec "perl test_mid /tmp/imip_mux_$i.sock $n_deployments client"; } for my $j (0..$n_mids_per_deployment-3) { unless (fork()) { exec "perl test_mid /tmp/imip_mux_$i.sock $n_deployments"; } } }