Comments (2)
Hi,
The general idea is to follow the same approach used in the underlying QUIC library which makes sense to me.
With this approach only 2 types are requires (SendStream
and RecvStream
) providing simple and immediate API. They are 2 very well defined objects providing the 2 different functionalities (send and receive), single-responsibility principle.
Other libraries might introduce composite types. For example, s2n-quic
, another QUIC library, uses multiple types and stream-functions: https://docs.rs/s2n-quic/latest/s2n_quic/connection/struct.Connection.html#
Multiple accept_*
function with enum
variants.
Maybe it was to unify the types with the unidirectional stream? (if that is the case, there can be a .split() function on this joined type that turns it into the two streams).
Indeed, this is true as well. I would avoid having UnidirectionalRecv
, UnidirectionalSend
and Bidirectional
(for a total of 3 types) where Bidirectional
overlaps code/functionalities.
However, I am not sure understanding your suggestion. How split
works with unidirectional stream? (I would imagine split
for bidirectional).
Moreover, current SendStream
and RecvStream
can be easily composable. I reckon you mentioned this, but I don't see how this might be complicated.
pub struct BiStream((SendStream, RecvStream));
impl AsyncRead BiStream { ... }
impl AsyncWrite BiStream { ... }
Maybe you can provide some code example also here, so we can see if we can find a better solution providing some helpers directly in wtransport
.
Side note: calling them streams is a bit confusing, because they implement AsyncWrite/Read rather than Stream or Sink. (Edit: I guess this was done because the webtransport api calls them streams).
Yeah :)
This is a little bit inconvenient, but QUIC works with Streams
.
Thanks
from wtransport.
Can you please have a look at: #135
Please add your feedback
from wtransport.
Related Issues (20)
- New release please HOT 1
- Access to low-level quinn details in client HOT 3
- PrivateKeyNotFound when key already exists. HOT 6
- Please implement the Clone trait for the Identity HOT 1
- Access to low-level `quinn::Connection`
- WebTransport TLS Keying Material Exporter HOT 1
- Feature request: `SessionRequest::remote_address(&self) -> SocketAddr`
- Feature request: `SessionRequest::too_many_requests()`
- Bug report: `Connection::remote_address` returns IPv6 addresses despite using IPv4 HOT 5
- Firefox support HOT 4
- The `with_server_certificate_hashes` on the *client* should not be under a feature flag HOT 5
- Expose the server certificate hashes cert verifier for external use
- Is there a reason to have separate client and server endpoints? HOT 4
- Allow assigning fields at `ClientConfig` HOT 3
- wtransport for IOS & Android?
- `SendStream::stopped` requires move
- looping over RecvStream::read causes an infinite loop without the client sending anything. HOT 10
- Make receive_datagram return BytesMut HOT 4
- Version 0.1.13 does not build without default features HOT 1
- Wrong model for stream error codes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wtransport.