socket

package
v0.0.0-...-0608f30 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TCPFastOpenConnectSupported = func() bool {
	if envVar := os.Getenv("STORJ_SOCKET_TCP_FASTOPEN_CONNECT"); envVar != "" {
		if supported, err := strconv.ParseBool(envVar); err == nil {
			return supported
		}
	}

	return true
}()

TCPFastOpenConnectSupported is true if TCPFastOpenConnect is supported on this platform.

Functions

This section is empty.

Types

type ExtendedDialer

type ExtendedDialer struct {
	// LowPrioCongestionControl, if set, will try to set the lowest priority socket
	// settings, changing the congestion controller to a background congestion
	// controller if possible or available. On Linux, will use the kernel module
	// specified by STORJ_SOCKET_LOWPRIO_CTL. On Linux, 'cdg' is
	// recommended, with module parameters use_shadow=0 and use_ineff=0.
	LowPrioCongestionControl bool

	// LowEffortQoS, if set, will tell outgoing connections to try to set the low effort DSCP flag.
	LowEffortQoS bool

	// TCPFastOpenConnect is a Linux-only option that, if set, will tell outgoing
	// connections to try and dial with TCP_FASTOPEN.
	TCPFastOpenConnect bool
}

ExtendedDialer provides a DialContext that knows how to set different operating system options.

func (ExtendedDialer) DialContext

func (b ExtendedDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

DialContext will dial with the provided ExtendedDialer settings.

Jump to

Keyboard shortcuts

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