bbrconn

package module
v0.0.0-...-1216991 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Overview

Package bbrconn provides a wrapper around net.Conn that exposes BBR congestion control information. This works only on Linux with Kernel 4.9.0 or newer installed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BBRInfo

type BBRInfo struct {
	// MaxBW is the maximum bottleneck bandwidth in bits per seconds (bps)
	MaxBW uint64
}

type Conn

type Conn interface {
	net.Conn

	// BytesWritten returns the number of bytes written to this connection
	BytesWritten() int

	// TCPInfo returns TCP connection info from the kernel
	TCPInfo() (*TCPInfo, error)

	// BBRInfo returns BBR congestion avoidance info from the kernel
	BBRInfo() (*BBRInfo, error)
}

func Wrap

func Wrap(conn net.Conn, onClose InfoCallback) (Conn, error)

type InfoCallback

type InfoCallback func(bytesWritten int, info *TCPInfo, bbrInfo *BBRInfo, err error)

type TCPInfo

type TCPInfo struct {
	SenderMSS           uint
	RTT                 time.Duration
	SysSegsOut          uint
	SysTotalRetransSegs uint
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL