Skip to content

Commit

Permalink
Add cid_len option to tquic tools (Tencent#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
iyangsj authored Jan 12, 2024
1 parent 414f8ac commit f71422e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/src/bin/tquic_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ pub struct ClientOpt {
#[clap(long, value_name = "FILE")]
pub qlog_file: Option<String>,

/// Length of connection id in bytes.
#[clap(long, default_value = "8", value_name = "NUM")]
pub cid_len: usize,

/// Batch size for sending packets.
#[clap(long, default_value = "1", value_name = "NUM")]
pub send_batch_size: usize,
Expand Down Expand Up @@ -422,6 +426,7 @@ impl Worker {
config.set_max_pto(option.max_pto);
config.set_max_concurrent_conns(option.max_concurrent_conns);
config.set_initial_max_streams_bidi(option.max_concurrent_requests);
config.set_cid_len(option.cid_len);
config.set_send_batch_size(option.send_batch_size);
config.set_recv_udp_payload_size(option.recv_udp_payload_size);
config.set_send_udp_payload_size(option.send_udp_payload_size);
Expand Down
5 changes: 5 additions & 0 deletions tools/src/bin/tquic_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ pub struct ServerOpt {
#[clap(long, value_name = "FILE")]
pub qlog_file: Option<String>,

/// Length of connection id in bytes.
#[clap(long, default_value = "8", value_name = "NUM")]
pub cid_len: usize,

/// Batch size for sending packets.
#[clap(long, default_value = "16", value_name = "NUM")]
pub send_batch_size: usize,
Expand Down Expand Up @@ -185,6 +189,7 @@ impl Server {
config.set_initial_rtt(option.initial_rtt);
config.set_pto_linear_factor(option.pto_linear_factor);
config.set_max_pto(option.max_pto);
config.set_cid_len(option.cid_len);
config.set_send_batch_size(option.send_batch_size);
config.set_congestion_control_algorithm(option.congestion_control_algor);
config.set_initial_congestion_window(option.initial_congestion_window);
Expand Down

0 comments on commit f71422e

Please sign in to comment.