Skip to content

Commit fbf54df

Browse files
update documentation for the new quic-go v0.53.0 API
1 parent 4b8d31d commit fbf54df

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

content/docs/http3/datagrams.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The `http3.ClientConn` manages a single QUIC connection to a remote server.
7878
The client is required to check that the server enabled HTTP datagrams support by checking the SETTINGS:
7979

8080
```go
81-
// ... dial a quic.Connection to the target server
81+
// ... dial a quic.Conn to the target server
8282
// make sure to set the "h3" ALPN
8383
tr := &http3.Transport{
8484
EnableDatagrams: true,

content/docs/quic/client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ As mentioned above, the client applies the flow control limits used on the initi
134134

135135
Upon rejecting 0-RTT, the server discards all 0-RTT packets sent by the client. This results in the invalidation of all opened streams and any data sent. quic-go does not automatically retransmit data sent in 0-RTT after completion of the handshake. It's the application's responsibility to detect this error and respond appropriately.
136136

137-
The `quic.Connection` returned by `DialEarly` behaves as if it had been [closed]({{< relref "connection.md#closing" >}}): all calls to `OpenStream`, `AcceptStream`, as well as `Read` and `Write` calls on streams return a `quic.Err0RTTRejected`. **However, the underlying QUIC connection remains open**, it is only used as a signal to the application that all data sent so far was not processed by the server. To continue communication, the application can transition to using `NextConnection`:
137+
The `quic.Conn` returned by `DialEarly` behaves as if it had been [closed]({{< relref "connection.md#closing" >}}): all calls to `OpenStream`, `AcceptStream`, as well as `Read` and `Write` calls on streams return a `quic.Err0RTTRejected`. **However, the underlying QUIC connection remains open**, it is only used as a signal to the application that all data sent so far was not processed by the server. To continue communication, the application can transition to using `NextConnection`:
138138

139139
```go
140140
conn, err := tr.DialEarly(ctx, <server address>, <tls.Config>, <quic.Config>)

content/docs/quic/connection-migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ tr1 := &quic.Transport{
3939
tr2 := &quic.Transport{
4040
Conn: conn2, // for example: a connection bound to the cellular interface
4141
}
42-
var conn quic.Connection // connection established on tr1
42+
var conn *quic.Conn // connection established on tr1
4343

4444
path, err := conn.AddPath(tr2)
4545
// ... error handling

content/docs/quic/connection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ toc: true
44
weight: 4
55
---
66

7-
The `quic.Connection` is the central object to send and receive application data. Data is not sent directly on the connection, but either on [streams]({{< relref "streams.md" >}}), or (optionally) in so-called [datagrams]({{< relref "datagrams.md" >}}).
7+
The `quic.Conn` is the central object to send and receive application data. Data is not sent directly on the connection, but either on [streams]({{< relref "streams.md" >}}), or (optionally) in so-called [datagrams]({{< relref "datagrams.md" >}}).
88

99

1010
## Using the Connection Context {#conn-context}
@@ -50,7 +50,7 @@ This allows applications to clean up state that might they might have created in
5050

5151
## Closing a Connection {#closing}
5252

53-
At any point during the connection, a `quic.Connection` can be closed by calling `CloseWithError`:
53+
At any point during the connection, a `quic.Conn` can be closed by calling `CloseWithError`:
5454

5555
```go
5656
conn.CloseWithError(0x42, "I don't want to talk to you anymore 🙉")

content/docs/quic/datagrams.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ weight: 10
66

77
## The Unreliable Datagram Extension
88

9-
Unreliable datagrams are not part of QUIC (RFC 9000) itself, but a feature that is added by a QUIC extension ([RFC 9221](https://datatracker.ietf.org/doc/html/rfc9221)). As other extensions, it can be negotiated during the handshake. Support can be enabled by setting the `quic.Config.EnableDatagram` flag. Note that this doesn't guarantee that the peer also supports datagrams. Whether or not the feature negotiation succeeded can be learned from the `ConnectionState.SupportsDatagrams` obtained from `Connection.ConnectionState()`.
9+
Unreliable datagrams are not part of QUIC (RFC 9000) itself, but a feature that is added by a QUIC extension ([RFC 9221](https://datatracker.ietf.org/doc/html/rfc9221)). As other extensions, it can be negotiated during the handshake. Support can be enabled by setting the `quic.Config.EnableDatagram` flag. Note that this doesn't guarantee that the peer also supports datagrams. Whether or not the feature negotiation succeeded can be learned from the `ConnectionState.SupportsDatagrams` obtained from `Conn.ConnectionState()`.
1010

1111
QUIC DATAGRAMs are a new QUIC frame type sent in QUIC 1-RTT packets (i.e. after completion of the handshake). Therefore, they're end-to-end encrypted and congestion-controlled. However, if a DATAGRAM frame is deemed lost by QUIC's loss detection mechanism, they are not retransmitted.
1212

1313
## Sending and Receiving Datagrams
1414

15-
Datagrams are sent using the `SendDatagram` method on the `quic.Connection`:
15+
Datagrams are sent using the `SendDatagram` method on the `quic.Conn`:
1616

1717
```go
1818
conn.SendDatagram([]byte("foobar"))

content/docs/quic/server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ for {
2323
}
2424
```
2525

26-
The listener `ln` can now be used to accept incoming QUIC connections by (repeatedly) calling the `Accept` method (see below for more information on the `quic.Connection`).
26+
The listener `ln` can now be used to accept incoming QUIC connections by (repeatedly) calling the `Accept` method (see below for more information on the `quic.Conn`).
2727

2828
This listener can be closed independently from the underlying transport. Connections that are already established and accepted won't be affected, but clients won't be able to establish new connections.
2929

@@ -103,7 +103,7 @@ go func() {
103103

104104
As soon as the connection is accepted, it can open streams and send application data. If [datagram support]({{< relref "datagrams.md" >}}) is negotiated, datagrams can be sent as well.
105105

106-
At any point, the application can wait for completion of the handshake by blocking on the channel returned by `Connection.HandshakeComplete()`.
106+
At any point, the application can wait for completion of the handshake by blocking on the channel returned by `Conn.HandshakeComplete()`.
107107

108108

109109
## 0-RTT

content/docs/quic/streams.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ toc: true
44
weight: 6
55
---
66

7-
QUIC is a stream-multiplexed transport. A `quic.Connection` fundamentally differs from the `net.Conn` and the `net.PacketConn` interface defined in the standard library.
7+
QUIC is a stream-multiplexed transport. A QUIC connection fundamentally differs from the `net.Conn` and the `net.PacketConn` interface defined in the standard library.
88

9-
Data is sent and received on (unidirectional and bidirectional) streams, not on the connection itself. The stream state machine is described in detail in [Section 3 of RFC 9000](https://datatracker.ietf.org/doc/html/rfc9000#section-3).
9+
Application data is sent and received on (unidirectional and bidirectional) streams, not on the connection itself. The stream state machine is described in detail in [Section 3 of RFC 9000](https://datatracker.ietf.org/doc/html/rfc9000#section-3).
1010

11-
In addition to QUIC streams, application data can also sent in so-called QUIC datagram frames (see [datagrams]({{< relref path="datagrams.md" >}})), if implementations can negotiate support for it.
11+
In addition to QUIC streams, application data can also sent in so-called QUIC datagram frames (see [datagrams]({{< relref path="datagrams.md" >}})), if endpoints negotiate support for it.
1212

1313

1414
## Stream Types
@@ -46,7 +46,7 @@ These functions return an error when the underlying QUIC connection is closed.
4646

4747
As described in [Flow Control for Streams]({{< relref "flowcontrol.md#stream-num" >}}), endpoints impose limits on how many streams a peer may open. The receiver may grant additional streams at any point in the connection (typically when existing streams are closed), but it means that at the time we want to open a new stream, we might not be able to do so.
4848

49-
`OpenStream` attempts to open a new bidirectional stream (`quic.Stream`), and it never blocks. If it's currently not possible to open a new stream, it returns a `net.Error` timeout error:
49+
`OpenStream` attempts to open a new bidirectional stream (`quic.Stream`), and it never blocks. If it's currently not possible to open a new stream, it returns a `net.Error` timeout error:
5050

5151
```go
5252
str, err := conn.OpenStream()

content/docs/webtransport/session.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ weight: 3
66

77
A WebTransport Session functions similarly to a [QUIC Connection]({{< relref "../quic/connection.md" >}}), enabling the opening and accepting of streams, as well as the sending and receiving of datagrams.
88

9-
The API of `webtransport.Session` is _almost_ identical to that of `quic.Connection`, with a few minor differences: For example, QUIC allows streams to be reset using a 62-bit error code, whereas WebTransport limits the error code range to 32 bits.
9+
The API of `webtransport.Session` is _almost_ identical to that of `quic.Conn`, with a few minor differences: For example, QUIC allows streams to be reset using a 62-bit error code, whereas WebTransport limits the error code range to 32 bits.
1010

1111
## Closing a WebTransport Session
1212

@@ -15,7 +15,7 @@ The WebTransport session can be closed by calling the `CloseWithError` method:
1515
sess.CloseWithError(1234, "please stop talking to me 🤐")
1616
```
1717

18-
Similar to closing a `quic.Connection`, this action causes all calls to `AcceptStream` and `OpenStream`, as well as stream `Read` and `Write` calls, to return immediately.
18+
Similar to closing a `quic.Conn`, this action causes all calls to `AcceptStream` and `OpenStream`, as well as stream `Read` and `Write` calls, to return immediately.
1919

2020
{{< callout type="warning" >}}
2121
`CloseWithError` only closes the WebTransport session, but not the underlying QUIC connection.

0 commit comments

Comments
 (0)