Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract udp crate #1180

Merged
merged 3 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = ["quinn", "quinn-proto", "interop", "bench", "perf", "fuzz"]
default-members = ["quinn", "quinn-proto", "interop", "bench", "perf"]
members = ["quinn", "quinn-proto", "quinn-udp", "interop", "bench", "perf", "fuzz"]
default-members = ["quinn", "quinn-proto", "quinn-udp", "interop", "bench", "perf"]

[profile.bench]
debug = true
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This library is at [draft 32][current-draft].

- **quinn:** High-level async API based on tokio, see for usage. This will be used by most developers. (Basic benchmarks are included.)
- **quinn-proto:** Deterministic state machine of the protocol which performs [**no** I/O][sans-io] internally and is suitable for use with custom event loops (and potentially a C or C++ API).
- **quinn-udp:** UDP sockets with ECN information tuned for the protocol.
- **quinn-h3:** Contains an implementation of HTTP-3 and QPACK. It is split internally in a deterministic state machine and a tokio-based high-level async API.
- **bench:** Benchmarks without any framework.
- **interop:** Tooling that helps to run interoperability tests.
Expand Down
2 changes: 1 addition & 1 deletion quinn-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "quinn-proto"
version = "0.7.0"
authors = ["Benjamin Saunders <ben.e.saunders@gmail.com>", "Dirkjan Ochtman <dirkjan@ochtman.nl>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/djc/quinn"
repository = "https://github.com/quinn-rs/quinn"
description = "State machine for the QUIC transport protocol"
keywords = ["quic"]
categories = [ "network-programming", "asynchronous" ]
Expand Down
29 changes: 29 additions & 0 deletions quinn-udp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "quinn-udp"
version = "0.7.0"
authors = ["Benjamin Saunders <ben.e.saunders@gmail.com>", "Dirkjan Ochtman <dirkjan@ochtman.nl>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/quinn-rs/quinn"
description = "UDP sockets with ECN information for the QUIC transport protocol"
keywords = ["quic"]
categories = [ "network-programming", "asynchronous" ]
workspace = ".."
edition = "2018"

[package.metadata.docs.rs]
all-features = true

[badges]
maintenance = { status = "experimental" }

[dependencies]
futures-util = { version = "0.3.11", features = ["io"] }
libc = "0.2.69"
mio = { version = "0.7.7", features = ["net"] }
proto = { package = "quinn-proto", path = "../quinn-proto", version = "0.7" }
Ralith marked this conversation as resolved.
Show resolved Hide resolved
socket2 = "0.4"
tracing = "0.1.10"
tokio = { version = "1.0.1", features = ["net"] }

[target.'cfg(unix)'.dependencies]
lazy_static = "1"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 3 additions & 8 deletions quinn/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "quinn"
version = "0.7.0"
authors = ["Benjamin Saunders <ben.e.saunders@gmail.com>", "Dirkjan Ochtman <dirkjan@ochtman.nl>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/djc/quinn"
repository = "https://github.com/quinn-rs/quinn"
description = "QUIC transport protocol implementation for Tokio"
readme = "../README.md"
keywords = ["quic"]
Expand Down Expand Up @@ -33,20 +33,15 @@ bytes = "1"
futures-util = { version = "0.3.11", default-features = false, features = ["io"] }
futures-channel = "0.3.11"
fxhash = "0.2.1"
libc = "0.2.69"
mio = { version = "0.7.7", features = ["net"] }
once_cell = "1.7.2"
proto = { package = "quinn-proto", path = "../quinn-proto", version = "0.7", default-features = false }
rustls = { version = "0.19", features = ["quic"], optional = true }
socket2 = "0.4"
thiserror = "1.0.21"
tracing = "0.1.10"
tokio = { version = "1.0.1", features = ["net", "rt", "time"] }
tokio = { version = "1.0.1", features = ["rt", "time"] }
udp = { package = "quinn-udp", path = "../quinn-udp", version = "0.7" }
webpki = { version = "0.21", default-features = false, optional = true }

[target.'cfg(unix)'.dependencies]
lazy_static = "1"

[dev-dependencies]
anyhow = "1.0.22"
crc = "1.8.1"
Expand Down
6 changes: 2 additions & 4 deletions quinn/src/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ use proto::{
};
use thiserror::Error;
use tracing::error;
use udp::UdpSocket;

use crate::{
endpoint::{Endpoint, EndpointDriver, EndpointRef, Incoming},
platform::UdpSocket,
};
use crate::endpoint::{Endpoint, EndpointDriver, EndpointRef, Incoming};
#[cfg(feature = "rustls")]
use crate::{Certificate, CertificateChain, PrivateKey};

Expand Down
2 changes: 1 addition & 1 deletion quinn/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ use proto::{ConnectionError, ConnectionHandle, ConnectionStats, Dir, StreamEvent
use thiserror::Error;
use tokio::time::{sleep_until, Instant as TokioInstant, Sleep};
use tracing::info_span;
use udp::caps;

use crate::{
broadcast::{self, Broadcast},
mutex::Mutex,
platform::caps,
recv_stream::RecvStream,
send_stream::{SendStream, WriteError},
ConnectionEvent, EndpointEvent, VarInt,
Expand Down
2 changes: 1 addition & 1 deletion quinn/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ use proto::{
generic::{ClientConfig, ServerConfig},
ConnectError, ConnectionHandle, DatagramEvent,
};
use udp::{RecvMeta, UdpSocket, BATCH_SIZE};

use crate::{
broadcast::{self, Broadcast},
builders::EndpointBuilder,
connection::Connecting,
platform::{RecvMeta, UdpSocket, BATCH_SIZE},
work_limiter::WorkLimiter,
ConnectionEvent, EndpointEvent, VarInt, IO_LOOP_BOUND, RECV_TIME_BOUND, SEND_TIME_BOUND,
};
Expand Down
1 change: 0 additions & 1 deletion quinn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ mod builders;
mod connection;
mod endpoint;
mod mutex;
mod platform;
mod recv_stream;
mod send_stream;
mod work_limiter;
Expand Down