diff --git a/coverage/examples/basic.rs.html b/coverage/examples/basic.rs.html
index 09b858c..238f60c 100644
--- a/coverage/examples/basic.rs.html
+++ b/coverage/examples/basic.rs.html
@@ -9,7 +9,7 @@
-
1use anyhow::{Error, Result};
-
2use fabruic::{Endpoint, KeyPair};
-
3use futures_util::{future, StreamExt, TryFutureExt};
-
-
5const SERVER_NAME: &str = "test";
-
-
7const SERVER_PORT: u16 = 34857;
-
8const CLIENTS: usize = 100;
-
-
-
111#[cfg_attr(test, test)]
-
121async fn main() -> Result<()> {
-
-
141 let mut clients = Vec::with_capacity(CLIENTS);
-
-
161 // generate a certificate pair
-
171 let key_pair = KeyPair::new_self_signed(SERVER_NAME);
-
-
-
20 // we want to do this outside to reserve the `SERVER_PORT`, otherwise spawned
-
21 // clients may take it
-
221 let mut server = Endpoint::new_server(SERVER_PORT, key_pair.clone())?;
-
231 let address = format!("quic://{}", server.local_address()?);
-
-
-
26101 for index in 0..CLIENTS {
-
27100 let address = address.clone();
-
28100 let certificate = key_pair.end_entity_certificate().clone();
-
-
-
31100 tokio::spawn(async move {
-
-
33100 let client = Endpoint::new_client()?;
-
-
35100 let connecting = client.connect_pinned(address, &certificate, None).await?;
-
-
37100 "[client:{}] Connecting to {}",
-
-
39100 connecting.remote_address()
-
-
41100 let connection = connecting.accept::<()>().await?;
-
-
43100 "[client:{}] Successfully connected to {}",
-
-
45100 connection.remote_address()
-
-
47100 connection.close_incoming().await?;
-
-
-
50100 let (sender, mut receiver) = connection.open_stream::<String, String>(&()).await?;
-
-
52100 "[client:{}] Successfully opened stream to {}",
-
-
54100 connection.remote_address()
-
-
-
-
58100 sender.send(&format!("hello from client {}", index))?;
-
-
60 // start listening to new incoming messages
-
61 // in this example we know there is only 1 incoming message, so we will
-
-
63100 let message = receiver.next().await.expect("no message found")?;
-
-
65100 "[client:{}] New message from {}: {}",
-
-
67100 connection.remote_address(),
-
-
-
-
71100 // wait for stream to finish
-
72100 sender.finish().await?;
-
73100 receiver.finish().await?;
-
-
75 // wait for client to finish cleanly
-
76100 client.wait_idle().await;
-
-
78100 "[client:{}] Successfully finished {}",
-
-
80100 client.local_address()?
-
-
-
83100 Result::<_, Error>::Ok(())
-
-
85100 .map_err(Error::from)
-
86100 .and_then(future::ready),
-
-
-
-
-
911 println!("[server] Listening on {}", server.local_address()?);
-
-
93 // collect incoming connection tasks
-
941 let mut connections = Vec::with_capacity(CLIENTS);
-
-
96 // start listening to new incoming connections
-
97 // in this example we know there is `CLIENTS` number of clients, so we will not
-
-
99101 for _ in 0..CLIENTS {
-
100100 let connecting = server.next().await.expect("connection failed");
-
-
-
103100 "[server] New incoming Connection: {}",
-
104100 connecting.remote_address()
-
-
-
107100 // every new incoming connections is handled in it's own task
-
-
109100 tokio::spawn(async move {
-
110100 let mut connection = connecting.accept::<()>().await?;
-
111100 println!("[server] New Connection: {}", connection.remote_address());
-
-
113 // start listening to new incoming streams
-
114 // in this example we know there is only 1 incoming stream, so we will not wait
-
-
116100 let incoming = connection.next().await.expect("no stream found")?;
-
117100 connection.close_incoming().await?;
-
-
119100 "[server] New incoming stream from: {}",
-
120100 connection.remote_address()
-
-
-
-
124100 let (sender, mut receiver) = incoming.accept::<String, String>().await?;
-
-
126 // start listening to new incoming messages
-
127 // in this example we know there is only 1 incoming message, so we will not wait
-
-
129100 let message = receiver.next().await.expect("no message found")?;
-
-
131100 "[server] New message from {}: {}",
-
132100 connection.remote_address(),
-
-
-
-
-
137100 sender.send(&String::from("hello from server"))?;
-
-
139 // wait for stream to finish
-
140100 sender.finish().await?;
-
141100 receiver.finish().await?;
+
+
+
3use anyhow::{Error, Result};
+
4use fabruic::{Endpoint, KeyPair};
+
5use futures_util::{future, StreamExt, TryFutureExt};
+
+
7/// Used in the certificate.
+
8const SERVER_NAME: &str = "test";
+
+
10const SERVER_PORT: u16 = 34857;
+
11/// Number of clients to simulate.
+
12const CLIENTS: usize = 100;
+
+
+
151#[cfg_attr(test, test)]
+
161async fn main() -> Result<()> {
+
+
181 let mut clients = Vec::with_capacity(CLIENTS);
+
+
201 // generate a certificate pair
+
211 let key_pair = KeyPair::new_self_signed(SERVER_NAME);
+
+
+
24 // we want to do this outside to reserve the `SERVER_PORT`, otherwise spawned
+
25 // clients may take it
+
261 let mut server = Endpoint::new_server(SERVER_PORT, key_pair.clone())?;
+
271 let address = format!("quic://{}", server.local_address()?);
+
+
+
30101 for index in 0..CLIENTS {
+
31100 let address = address.clone();
+
32100 let certificate = key_pair.end_entity_certificate().clone();
+
+
+
35100 tokio::spawn(async move {
+
+
37100 let client = Endpoint::new_client()?;
+
+
39100 let connecting = client.connect_pinned(address, &certificate, None).await?;
+
+
41100 "[client:{}] Connecting to {}",
+
+
43100 connecting.remote_address()
+
+
45100 let connection = connecting.accept::<()>().await?;
+
+
47100 "[client:{}] Successfully connected to {}",
+
+
49100 connection.remote_address()
+
+
51100 connection.close_incoming().await?;
+
+
+
54100 let (sender, mut receiver) = connection.open_stream::<String, String>(&()).await?;
+
+
56100 "[client:{}] Successfully opened stream to {}",
+
+
58100 connection.remote_address()
+
+
+
+
62100 sender.send(&format!("hello from client {index}"))?;
+
+
64 // start listening to new incoming messages
+
65 // in this example we know there is only 1 incoming message, so we will
+
+
67100 let message = receiver.next().await.expect("no message found")?;
+
+
69100 "[client:{}] New message from {}: {}",
+
+
71100 connection.remote_address(),
+
+
+
+
75100 // wait for stream to finish
+
76100 sender.finish().await?;
+
77100 receiver.finish().await?;
+
+
79 // wait for client to finish cleanly
+
80100 client.wait_idle().await;
+
+
82100 "[client:{}] Successfully finished {}",
+
+
84100 client.local_address()?
+
+
+
87100 Result::<_, Error>::Ok(())
+
+
89100 .map_err(Error::from)
+
90100 .and_then(future::ready),
+
+
+
+
+
951 println!("[server] Listening on {}", server.local_address()?);
+
+
97 // collect incoming connection tasks
+
981 let mut connections = Vec::with_capacity(CLIENTS);
+
+
100 // start listening to new incoming connections
+
101 // in this example we know there is `CLIENTS` number of clients, so we will not
+
+
103101 for _ in 0..CLIENTS {
+
104100 let connecting = server.next().await.expect("connection failed");
+
+
+
107100 "[server] New incoming Connection: {}",
+
108100 connecting.remote_address()
+
+
+
111100 // every new incoming connections is handled in it's own task
+
+
113100 tokio::spawn(async move {
+
114100 let mut connection = connecting.accept::<()>().await?;
+
115100 println!("[server] New Connection: {}", connection.remote_address());
+
+
117 // start listening to new incoming streams
+
118 // in this example we know there is only 1 incoming stream, so we will not wait
+
+
120100 let incoming = connection.next().await.expect("no stream found")?;
+
121100 connection.close_incoming().await?;
+
+
123100 "[server] New incoming stream from: {}",
+
124100 connection.remote_address()
+
+
+
+
128100 let (sender, mut receiver) = incoming.accept::<String, String>().await?;
+
+
130 // start listening to new incoming messages
+
131 // in this example we know there is only 1 incoming message, so we will not wait
+
+
133100 let message = receiver.next().await.expect("no message found")?;
+
+
135100 "[server] New message from {}: {}",
+
136100 connection.remote_address(),
+
+
+
+
+
141100 sender.send(&String::from("hello from server"))?;
-
143100 Result::<_, Error>::Ok(())
-
-
145100 .map_err(Error::from)
-
146100 .and_then(future::ready),
-
-
-
-
1501 server.close_incoming().await?;
-
-
152 // wait for all connections to finish
-
15333 future::try_join_all(connections).await?;
-
-
155 // wait for server to finish cleanly
-
1561 server.wait_idle().await;
-
1571 println!("[server] Successfully finished {}", server.local_address()?);
+
143 // wait for stream to finish
+
144100 sender.finish().await?;
+
145100 receiver.finish().await?;
+
+
147100 Result::<_, Error>::Ok(())
+
+
149100 .map_err(Error::from)
+
150100 .and_then(future::ready),
+
+
+
+
1541 server.close_incoming().await?;
+
+
156 // wait for all connections to finish
+
15735 future::try_join_all(connections).await?;
-
15963 future::try_join_all(clients).await?;
-
-
-
+
159 // wait for server to finish cleanly
+
1601 server.wait_idle().await;
+
1611 println!("[server] Successfully finished {}", server.local_address()?);
+
+
16331 future::try_join_all(clients).await?;
+
+
+