quic: add quic
Working on adding QUIC back. This is a bit of a rewrite of the original and is not yet complete (thus the draft status).
There are several important bits here:
-
The internal classes are
Endpoint
,EndpointWrap
,Session
, andStream
(originally these were namedQuicSocket
,QuicSession
, andQuicStream
. -
Endpoint
andEndpointWrap
are a bit special...
-
Endpoint
wraps auv_udp_t
but does not wrapUDPWrap
. The reason is to give us finer control over how the UDP port is used and configured, and how data flows. -
EndpointWrap
is the JS Wrapper object aroundEndpoint
. It is designed to be cloneable viaMessagePort
. What that means is that anEndpoint
(and it's associateduv_udp_t
can essentially be shared across multiple worker threads while still being owned by a single event loop). It makes the implementation a bit more complicated but opens up the ability for processing QUIC sessions across multiple worker threads.
-
Stream
is no longer aStreamBase
. In fact, while the QUIC implementation will be capable of sending from aReadable
stream, and will support being read as aReadable
, the QUIC JavaScriptStream
object will not be a Node.js stream object. This is a major API change from the original implementation. More details on this later, but the usage pattern will be closer to what we see in browser environments (e.g.stream.blob()
,stream.readable()
,stream.text()
, etc). -
There's
noonly partial JS API exposed hereyet. That's coming as I work through the rewrite.