parent
d11eb04d12
commit
a6c4e56835
14 changed files with 126 additions and 63 deletions
|
|
@ -1,19 +1,23 @@
|
|||
# MTP Connections
|
||||
|
||||
Native clients and hosts share the same connection shape after the opening handshake. The client creates the connection; the host receives it from `accept()`.
|
||||
Native clients and server-side hosts expose parallel connection handles after the
|
||||
opening handshake. The client creates its handle; the host receives one from
|
||||
`accept()`.
|
||||
|
||||
| Member | Native client | Native host | Web host (`WebMTPConnection`) |
|
||||
| --- | --- | --- | --- |
|
||||
| `version` | Compiled client version accepted by the host | Version selected by the registry | Version selected by the registry |
|
||||
| `sender` | Sends `CommunicationValue` frames | Sends `CommunicationValue` frames | Sends `CommunicationValue` frames |
|
||||
| `receiver` | Receives application frames | Receives application frames | Receives application frames |
|
||||
| `receiver` | Underlying receiver; use `receive()` for application frames | Underlying receiver; use `receive()` for application frames | Underlying receiver; use `receive()` for application frames |
|
||||
| `description` | Optional label sent during setup | Optional label received from the client | Optional label received from the client |
|
||||
| `client_id` | Confirmed or assigned ID with `crypto` | Authenticated or guest client ID with `crypto` | Authenticated or guest client ID with `crypto` |
|
||||
| `auth_state` | Authentication result with `crypto` | Authentication result with `crypto` | Authentication result with `crypto` |
|
||||
| `request_path` | / | / | WebTransport CONNECT path (e.g. `/mtp`) |
|
||||
| `path` | — | Native hosts use `/` | WebTransport CONNECT path (e.g. `/mtp`) |
|
||||
| `remote_addr` | Server `SocketAddr` when available | Peer `SocketAddr` | Peer `SocketAddr` |
|
||||
|
||||
`WebMTPConnection`, returned by `MTPWebServer::accept()`, exposes the same members as the native host connection plus `request_path`, which contains the HTTP/3 path used for the WebTransport extended CONNECT request.
|
||||
`WebMTPConnection`, returned by `MTPWebServer::accept()`, exposes the same
|
||||
server-side members as the native host connection. Its `path` contains the
|
||||
HTTP/3 path used for the WebTransport extended CONNECT request.
|
||||
|
||||
Server-side MTP connections expose `remote_addr`, the peer address observed by
|
||||
QUIC. HTTP route handlers receive the peer address as `HttpRequest::remote_addr`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue