Skip to content

Commit

Permalink
add more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
joliveirinha committed Aug 16, 2022
1 parent 977b842 commit 4174adf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion interface.go
Expand Up @@ -211,15 +211,22 @@ type EarlyConnection interface {
NextConnection() Connection
}

// A ConnectionIDGenerator is a interface that allows clients to implement their own format
// A ConnectionIDGenerator is an interface that allows clients to implement their own format
// for the Connection IDs that servers/clients use as SrcConnectionID in QUIC packets.
//
// Connection IDs generated by an implementation should always produce IDs of constant size.
type ConnectionIDGenerator interface {

// GenerateConnectionID generates a new ConnectionID.
// Generated ConnectionIDs should be unique and observers should not be able to correlate two ConnectionIDs.
GenerateConnectionID() ([]byte, error)

// ConnectionIDLen tells what is the length of the ConnectionIDs generated by the implementation of
// this interface.
// Effectively, this means that implementations of ConnectionIDGenerator must always return constant-size
// connection IDs. Valid lengths are between 0 and 20 and calls to GenerateConnectionID.
// 0-length ConnectionsIDs can be used when an endpoint (server or client) does not require multiplexing connections
// in the presence of a connection migration environment.
ConnectionIDLen() int
}

Expand Down

0 comments on commit 4174adf

Please sign in to comment.