File tree 1 file changed +17
-14
lines changed
hiccup/src/main/java/com/higherfrequencytrading/hiccup
1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -47,32 +47,35 @@ public static void main(String... args) throws IOException {
47
47
String hostname = "localhost" ;
48
48
int port = 65432 ;
49
49
50
- for (int i = 0 ; i < TESTS ; i ++) {
51
- for (int busy = 0 ; busy <= 1 ; busy ++) {
52
- BUSY = busy != 0 ;
50
+ switch (args .length ) {
51
+ case 0 :
52
+ for (int i = 0 ; i < TESTS ; i ++) {
53
+ for (int busy = 0 ; busy <= 1 ; busy ++) {
54
+ BUSY = busy != 0 ;
53
55
54
- switch (args .length ) {
55
- case 0 :
56
56
Thread thread = new Thread (new Acceptor (port + i ));
57
57
thread .setDaemon (true );
58
58
thread .start ();
59
59
new Sender (hostname , port + i ).run ();
60
60
thread .interrupt ();
61
- break ;
61
+ }
62
+ }
63
+ break ;
62
64
63
- case 1 :
64
- new Acceptor (port ).run ();
65
- // only run one.
66
- return ;
65
+ case 1 :
66
+ new Acceptor (port ).run ();
67
+ // only run one.
68
+ return ;
67
69
68
- case 2 :
69
- new Sender ( hostname , port ). run ();
70
- break ;
70
+ case 2 :
71
+ for ( int i = 0 ; i < TESTS ; i ++) {
72
+ new Sender ( hostname , port ). run () ;
71
73
}
72
- }
74
+ break ;
73
75
}
74
76
}
75
77
78
+
76
79
static class Acceptor implements Runnable {
77
80
private final ServerSocketChannel ssc ;
78
81
You can’t perform that action at this time.
0 commit comments