Skip to content

Connections

In QUIC protocols, connections are stripped from the process of transporting data.

A connection serves as a container for streams, which maintains the common states, parameters and the context between two endpoints.

After reading this page, you will know the steps of building or customizing a XQUIC connection.

You can also use the table below to navigate the relevant features:

  • Create
  • Destroy
  • Connection Migration
  • Keep Alive

Create a Connection

In QUIC protocol, connections is a prerequesite for sending or receiving data. The relevant state and context it maitains is the foundation for data transmission, though connection won't participate in data transmission directly.

The inner interface of create a connection is xqc_conn_create.

It's more convenient to use [xqc_connect] to trigger connection process in client.

Destroy a connection

Normally, connections will be destroyed in xqc_engine_destroy process using xqc_conn_destroy.

But in special case, connection are required to close manually.

Refer to xqc_conn_close for more details.

Create a h3 Connection

In special case, you may want to create a h3 connection, XQUIC encapsulate interface for h3 connection creation, use the APIs xqc_h3_connect in client to create a h3 connection.

Destroy a h3 Connection

HTTP/3 connection are currently closed and destroyed in conn_close_notify callback functions xqc_h3_conn_close_notify, using API xqc_h3_conn_destroy.

Further application layer callbacks can be handled using h3_conn_close_notify callback.

Connection Migration

XQUIC enables passive connection migration by default.

The rebinding process launched each time when host process a packet from a existing connection, but with unregistered peer address.

You can test connection migration by changing the fd manually during the transfer process, and observe the connection behaviour.