forked from quic-go/quic-go
move connection tracking into the Transport (#5113)
This commit is contained in:
25
sys_conn.go
25
sys_conn.go
@@ -1,6 +1,7 @@
|
||||
package quic
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
@@ -13,6 +14,30 @@ import (
|
||||
"github.com/quic-go/quic-go/internal/utils"
|
||||
)
|
||||
|
||||
type connCapabilities struct {
|
||||
// This connection has the Don't Fragment (DF) bit set.
|
||||
// This means it makes to run DPLPMTUD.
|
||||
DF bool
|
||||
// GSO (Generic Segmentation Offload) supported
|
||||
GSO bool
|
||||
// ECN (Explicit Congestion Notifications) supported
|
||||
ECN bool
|
||||
}
|
||||
|
||||
// rawConn is a connection that allow reading of a receivedPackeh.
|
||||
type rawConn interface {
|
||||
ReadPacket() (receivedPacket, error)
|
||||
// WritePacket writes a packet on the wire.
|
||||
// gsoSize is the size of a single packet, or 0 to disable GSO.
|
||||
// It is invalid to set gsoSize if capabilities.GSO is not set.
|
||||
WritePacket(b []byte, addr net.Addr, packetInfoOOB []byte, gsoSize uint16, ecn protocol.ECN) (int, error)
|
||||
LocalAddr() net.Addr
|
||||
SetReadDeadline(time.Time) error
|
||||
io.Closer
|
||||
|
||||
capabilities() connCapabilities
|
||||
}
|
||||
|
||||
// OOBCapablePacketConn is a connection that allows the reading of ECN bits from the IP header.
|
||||
// If the PacketConn passed to the [Transport] satisfies this interface, quic-go will use it.
|
||||
// In this case, ReadMsgUDP() will be used instead of ReadFrom() to read packets.
|
||||
|
||||
Reference in New Issue
Block a user