@@ -33,49 +33,57 @@ pub struct Args {
3333
3434 /// enable IPv6 on the server (on most hosts, this will allow both IPv4 and IPv6,
3535 /// but it might limit to just IPv6 on some)
36- #[ arg( short = '6' , long) ]
36+ #[ arg( short = '6' , long, conflicts_with = "client" ) ]
3737 pub version6 : bool ,
3838
3939 /// limit the number of concurrent clients that can be processed by a server;
4040 /// any over this count will be immediately disconnected
41- #[ arg( long, value_name = "number" , default_value = "0" ) ]
41+ #[ arg( long, value_name = "number" , default_value = "0" , conflicts_with = "client" ) ]
4242 pub client_limit : usize ,
4343
4444 /// run in client mode; value is the server's address
4545 #[ arg( short, long, value_name = "host" , conflicts_with = "server" ) ]
4646 pub client : Option < std:: net:: IpAddr > ,
4747
4848 /// run in reverse-mode (server sends, client receives)
49- #[ arg( short = 'R' , long) ]
49+ #[ arg( short = 'R' , long, conflicts_with = "server" ) ]
5050 pub reverse : bool ,
5151
5252 /// the format in which to deplay information (json, megabit/sec, megabyte/sec)
53- #[ arg( short, long, value_enum, value_name = "format" , default_value = "megabit" ) ]
53+ #[ arg(
54+ short,
55+ long,
56+ value_enum,
57+ value_name = "format" ,
58+ default_value = "megabit" ,
59+ conflicts_with = "server"
60+ ) ]
5461 pub format : Format ,
5562
5663 /// use UDP rather than TCP
57- #[ arg( short, long) ]
64+ #[ arg( short, long, conflicts_with = "server" ) ]
5865 pub udp : bool ,
5966
6067 /// target bandwidth in bytes/sec; this value is applied to each stream,
6168 /// with a default target of 1 megabit/second for all protocols (note: megabit, not mebibit);
6269 /// the suffixes kKmMgG can also be used for xbit and xbyte, respectively
63- #[ arg( short, long, default_value = "125000" , value_name = "bytes/sec" ) ]
70+ #[ arg( short, long, default_value = "125000" , value_name = "bytes/sec" , conflicts_with = "server" ) ]
6471 pub bandwidth : String ,
6572
6673 /// the time in seconds for which to transmit
67- #[ arg( short, long, default_value = "10.0" , value_name = "seconds" ) ]
74+ #[ arg( short, long, default_value = "10.0" , value_name = "seconds" , conflicts_with = "server" ) ]
6875 pub time : f64 ,
6976
7077 /// the interval at which to send batches of data, in seconds, between [0.0 and 1.0);
7178 /// this is used to evenly spread packets out over time
72- #[ arg( long, default_value = "0.05" , value_name = "seconds" ) ]
79+ #[ arg( long, default_value = "0.05" , value_name = "seconds" , conflicts_with = "server" ) ]
7380 pub send_interval : f64 ,
7481
7582 /// length of the buffer to exchange; for TCP, this defaults to 32 kibibytes; for UDP, it's 1024 bytes
7683 #[ arg(
7784 short,
7885 long,
86+ conflicts_with = "server" ,
7987 default_value = "32768" ,
8088 default_value_if( "udp" , "true" , Some ( "1024" ) ) ,
8189 value_name = "bytes"
@@ -85,27 +93,27 @@ pub struct Args {
8593 /// send buffer, in bytes (only supported on some platforms;
8694 /// if set too small, a 'resource unavailable' error may occur;
8795 /// affects TCP window-size)
88- #[ arg( long, default_value = "0" , value_name = "bytes" ) ]
96+ #[ arg( long, default_value = "0" , value_name = "bytes" , conflicts_with = "server" ) ]
8997 pub send_buffer : usize ,
9098
9199 /// receive buffer, in bytes (only supported on some platforms;
92100 /// if set too small, a 'resource unavailable' error may occur; affects TCP window-size)
93- #[ arg( long, default_value = "0" , value_name = "bytes" ) ]
101+ #[ arg( long, default_value = "0" , value_name = "bytes" , conflicts_with = "server" ) ]
94102 pub receive_buffer : usize ,
95103
96104 /// the number of parallel data-streams to use
97- #[ arg( short = 'P' , long, value_name = "number" , default_value = "1" ) ]
105+ #[ arg( short = 'P' , long, value_name = "number" , default_value = "1" , conflicts_with = "server" ) ]
98106 pub parallel : usize ,
99107
100108 /// omit a number of seconds from the start of calculations,
101109 /// primarily to avoid including TCP ramp-up in averages;
102110 /// using this option may result in disagreement between bytes sent and received,
103111 /// since data can be in-flight across time-boundaries
104- #[ arg( short, long, default_value = "0" , value_name = "seconds" ) ]
112+ #[ arg( short, long, default_value = "0" , value_name = "seconds" , conflicts_with = "server" ) ]
105113 pub omit : usize ,
106114
107115 /// use no-delay mode for TCP tests, disabling Nagle's Algorithm
108- #[ arg( short = 'N' , long) ]
116+ #[ arg( short = 'N' , long, conflicts_with = "server" ) ]
109117 pub no_delay : bool ,
110118
111119 /// an optional pool of IPv4 TCP ports over which data will be accepted;
0 commit comments