Commit Graph

116 Commits

Author SHA1 Message Date
Benjamin Saunders 612c9ac2b8 Remove unnecessary dropping in client/server examples 2021-01-26 06:46:32 +01:00
Benjamin Saunders 03de1d0374 Ensure graceful close in client example 2021-01-26 06:46:32 +01:00
Benjamin Saunders 1e5a538221 Limit concurrent streams rather than accept queue size
Previously, we limited the number of streams that could be opened by
the peer but not `accept`ed by the application. However, to guarantee
bounded resource use, applications will typically want to limit the
number of streams they process concurrently. While this could
be *approximately* implemented at the application layer by controlling
calls to accept, that approach has a significant drawback: If streams
are slow to process, the worst-case per-stream latency observed by a
peer who opens the maximum number of streams can be arbitrarily bad,
because streams may be opened above the limit the local application is
willing to process. Reducing the number of unaccepted streams
tolerated can reduce the proportion of streams affected, but reducing
it too low will increase the number of round trips required to open
any given number of streams, increasing average latency significantly.

As a side benefit, this reduces the effort needed for applications to
limit concurrency to a fixed quantity, which is expected to be the
overwhelmingly common case. Should a use case for dynamic concurrency
limits arise, we can expose a setter.
2021-01-22 11:39:00 -08:00
Dirkjan Ochtman 17fe82b598 Apply clippy fixes for 1.49 2021-01-01 11:16:05 -08:00
Benjamin Saunders 4e6f946423 Clarify example path behavior 2020-12-22 07:42:34 +01:00
Benjamin Saunders a92e070fab Note address family gotcha 2020-12-22 07:42:34 +01:00
Benjamin Saunders 36de1c2385 Fix errors in example README 2020-12-22 07:42:34 +01:00
Dirkjan Ochtman 4420b61aaa quinn: print socket addresses in example client/server 2020-12-11 16:17:48 -08:00
Luca Barbato fc2016103d Fix a typo 2020-12-04 10:30:40 +01:00
Timon 83cff80908 Create example README (#910) 2020-11-15 21:43:28 +01:00
Matthias Einwag 4c9c0dc3c6 Use vectors instead of boxed slices
Use vectors instead of boxed slices

The conversion from Vec<u8> into Box<[u8]> is not always for free.
It will call `Vec::into_boxed_slice`, which will call `shrink_to_fit`.
https://github.com/rust-lang/rust/blob/28f03ac4c08fc7ec62428d0b914e1510ce7ee2cb/library/alloc/src/vec.rs#L689

If the `Vec` isn't fully utilized before, this will cause a reallocation
and a copy of all data. This might currently happen with every
outgoing packet.

This change simply keeps things as `Vec<u8>`, which works just fine since
the IO layer can deal with it.
2020-10-31 10:27:00 -07:00
Dirkjan Ochtman d5b47f601d Unwrap unused results from invalid config values 2020-10-12 12:13:50 -07:00
DelusionalOptimist 751d660343 Fixed typo in quinn/examples/connection.rs 2020-09-09 16:42:35 +02:00
Dirkjan Ochtman f212256435 Clean up warnings/errors 2020-09-03 09:17:32 -07:00
Benjamin Saunders a1e8c56cb0 Update initial salt, retry integrity key/nonce, and versions 2020-06-30 08:57:14 +02:00
Dirkjan Ochtman 5484d37c76 Migrate to directories-next
directories is no longer being maintained and the final released version
causes a dependency conflict (cfg-if, versus tracing).
2020-06-22 14:46:13 +02:00
Benjamin Saunders 128c1b2a5e Decouple ClientHello data from peer identity
These are determined at different times for incoming connections, so
bundling them together was fairly ugly.
2020-06-07 14:42:16 +02:00
Benjamin Saunders ca689d33d6 Update version numbers for draft 28 2020-05-25 06:22:35 +02:00
Jesse Lucas 11a7c77992 Add usage documentation to quinn/examples/server.rs 2020-04-25 18:06:04 +02:00
Benjamin Saunders cbb3470c7e Update draft number 2020-03-08 12:04:26 -07:00
Dirkjan Ochtman 6cca808d14 Make rustls an optional dependency for quinn 2020-03-07 12:12:01 -08:00
Dirkjan Ochtman 0a4bca7049 Remove old authentication data APIs 2020-03-07 12:12:01 -08:00
Benjamin Saunders 31fabfe807 Fix panic in connection example 2020-02-27 07:05:37 +01:00
Benjamin Saunders 5774071b48 Spawn driver tasks implicitly 2020-01-13 09:54:26 +01:00
Benjamin Saunders 16e670c9f3 Simplify example common module 2020-01-13 08:54:04 +01:00
Benjamin Saunders 527444ed77 Simplify single_socket example 2020-01-13 08:54:04 +01:00
Benjamin Saunders 42ca1cc0a5 Simplify insecure_connection example 2020-01-13 08:54:04 +01:00
Benjamin Saunders 9a9d940e81 Simplify connection example 2020-01-13 08:54:04 +01:00
Benjamin Saunders 09729ebd23 Opaque config structs
Only exposing setters improves forwards compatibility and error
checking.
2020-01-13 08:53:05 +01:00
Benjamin Saunders b17bc14662 Don't expose connection IDs
These aren't particularly interesting to users and can change
unpredictably, so exposing them is an unnecessary footgun.
2020-01-12 10:07:04 +01:00
Dirkjan Ochtman 102f537d40 Fix remaining lints 2019-12-22 14:28:02 -08:00
Benjamin Saunders 03cd3e27f2 Correct style for latest rustfmt 2019-12-22 09:30:02 +01:00
daxpedda 7233455078 Update tokio, futures and bytes. (#528) 2019-12-02 10:42:05 +01:00
Benjamin Saunders f48aa59512 Document a NewConnection footgun and the meaning of server_name
Non-obvious details identified in the course of assisting a new user.
2019-11-29 22:14:16 +01:00
Benjamin Saunders 8d3a5958f4 Update version to draft 24 2019-11-25 15:08:39 +01:00
Benjamin Saunders 4902bfe6ba Use anyhow instead of failure in examples
Anyhow was already in our depgraph and is more modern and actively
maintained.
2019-11-19 11:46:43 -08:00
Benjamin Saunders 93690aa4c9 Fix buggy non-async-style tracing span in server example 2019-11-19 20:01:49 +01:00
Timon Post ac810125c1 merge imports 2019-11-19 08:23:35 +01:00
Benjamin Saunders a957bf4aa2 Replace slog with tracing 2019-10-29 10:36:50 +01:00
Benjamin Saunders 2dcb084347 Decouple incoming streams of differing directionalities 2019-09-29 07:38:30 +02:00
Benjamin Saunders 8e1c6b605e Remove ToSocketAddrs from EndpointBuilder::bind
Improves consistency with Endpoint::connect and removes the
possibility of silent blocking should the user pass in a domain
name. The generic API was originally motivated by the convenience of
passing in numeric addresses as strings, but `.parse().unwrap()` is
pretty easy too.
2019-09-29 07:21:06 +02:00
Benjamin Saunders 82b9455caf Use multithreaded tokio runtime for server example
Illustrates our support for more typical tokio patterns
2019-09-28 10:23:26 +02:00
Benjamin Saunders d07dc907ad Update for async/await 2019-09-28 10:23:26 +02:00
Dirkjan Ochtman 2afe7f597d Update initial salt and QUIC version to draft 23 2019-09-23 12:25:08 -07:00
Benjamin Saunders f50dd9f54a Restore NewConnection struct for parts of a connection
This enables forwards-compatibility with future extensions such as
a datagram stream.
2019-08-25 14:50:01 -07:00
Dirkjan Ochtman 01b9d212be Upgrade to url 2 2019-07-24 21:29:48 +02:00
Benjamin Saunders e7929713cd Handle unclear interop ALPN 2019-07-11 20:52:19 +02:00
Benjamin Saunders 5fbe96f46a Public VarInt type
Ensures correctness of application error codes without panics or
adding new internal failure paths.
2019-07-11 20:52:19 +02:00
Benjamin Saunders b502306ab3 Refactor ReadToEnd helper to work after reads 2019-07-05 08:35:26 +02:00
Benjamin Saunders 747d5a263b Colorful logging in examples 2019-06-24 19:31:38 +02:00