tcp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ReuseErrShouldRetry

func ReuseErrShouldRetry(err error) bool

ReuseErrShouldRetry diagnoses whether to retry after a reuse error. if we failed to bind, we should retry. if bind worked and this is a real dial error (remote end didnt answer) then we should not retry.

func ReuseportIsAvailable

func ReuseportIsAvailable() bool

reuseportIsAvailable returns whether reuseport is available to be used. This is here because we want to be able to turn reuseport on and off selectively. For now we use an ENV variable, as this handles our pressing need:

IPFS_REUSEPORT=false ipfs daemon

If this becomes a sought after feature, we could add this to the config. In the end, reuseport is a stop-gap.

Types

type TcpTransport

type TcpTransport struct {
	// contains filtered or unexported fields
}

func NewTCPTransport

func NewTCPTransport() *TcpTransport

NewTCPTransport creates a tcp transport object that tracks dialers and listeners created. It represents an entire tcp stack (though it might not necessarily be)

func (*TcpTransport) Dialer

func (t *TcpTransport) Dialer(laddr ma.Multiaddr, opts ...tpt.DialOpt) (tpt.Dialer, error)

func (*TcpTransport) Listen

func (t *TcpTransport) Listen(laddr ma.Multiaddr) (tpt.Listener, error)

func (*TcpTransport) Matches

func (t *TcpTransport) Matches(a ma.Multiaddr) bool

Jump to

Keyboard shortcuts

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