@@ -75,7 +75,7 @@ public void run() {
7575 private int port = 8080 ;
7676 private boolean useTls = true ;
7777 private boolean useAlts = false ;
78- private boolean setMcsLimit = false ;
78+ private int mcsLimit = - 1 ;
7979
8080 private ScheduledExecutorService executor ;
8181 private Server server ;
@@ -119,8 +119,8 @@ void parseArgs(String[] args) {
119119 usage = true ;
120120 break ;
121121 }
122- } else if ("set_max_concurrent_streams_limit " .equals (key )) {
123- setMcsLimit = Boolean . parseBoolean (value );
122+ } else if ("max_concurrent_streams_limit " .equals (key )) {
123+ mcsLimit = Integer . parseInt (value );
124124 // TODO: Make Netty server builder usable for IPV6 as well (not limited to MCS handling)
125125 addressType = Util .AddressType .IPV4 ; // To use NettyServerBuilder
126126 } else {
@@ -146,8 +146,8 @@ void parseArgs(String[] args) {
146146 + "\n for testing. Only effective when --use_alts=true."
147147 + "\n --address_type=IPV4|IPV6|IPV4_IPV6"
148148 + "\n What type of addresses to listen on. Default IPV4_IPV6"
149- + "\n --set_max_concurrent_streams_limit "
150- + "\n Whether to set the maximum concurrent streams limit"
149+ + "\n --max_concurrent_streams_limit=LIMIT "
150+ + "\n Set the maximum concurrent streams limit"
151151 );
152152 System .exit (1 );
153153 }
@@ -195,10 +195,8 @@ void start() throws Exception {
195195 if (v4Address != null && !v4Address .equals (localV4Address )) {
196196 ((NettyServerBuilder ) serverBuilder ).addListenAddress (v4Address );
197197 }
198- if (setMcsLimit ) {
199- ((NettyServerBuilder ) serverBuilder ).maxConcurrentCallsPerConnection (2 );
200- System .out .println ("TestServiceServer.start set mcs limit to 2 in netty server builder." );
201- System .out .flush ();
198+ if (mcsLimit != -1 ) {
199+ ((NettyServerBuilder ) serverBuilder ).maxConcurrentCallsPerConnection (mcsLimit );
202200 }
203201 break ;
204202 case IPV6 :
0 commit comments