# Functions
DefaultDialRanker determines the ranking of outgoing connection attempts.
NewSwarm constructs a Swarm.
NoDelayDialRanker ranks addresses with no delay.
WithConnectionGater sets a connection gater.
WithDialRanker configures swarm to use d as the DialRanker.
WithIPv6BlackHoleSuccessCounter configures swarm to use the provided config for IPv6 black hole detection n is the size of the sliding window used to evaluate black hole state min is the minimum number of successes out of n required to not block requests.
WithMetrics sets a metrics reporter.
WithMultiaddrResolver sets a custom multiaddress resolver.
WithReadOnlyBlackHoleDetector configures the swarm to use the black hole detector in read only mode.
WithUDPBlackHoleSuccessCounter configures swarm to use the provided config for UDP black hole detection n is the size of the sliding window used to evaluate black hole state min is the minimum number of successes out of n required to not block requests.
# Constants
ConcurrentFdDials is the number of concurrent outbound dials over transports that consume file descriptors.
DialAttempts governs how many times a goroutine will try to dial a given peer.
The 250ms value is from happy eyeballs RFC 8305.
The 250ms value is from happy eyeballs RFC 8305.
The 250ms value is from happy eyeballs RFC 8305.
delay for other transport addresses.
duration by which QUIC dials are delayed relative to previous QUIC dial.
duration by which TCP dials are delayed relative to the last QUIC dial.
RelayDelay is the duration by which relay dials are delayed relative to direct addresses.
# Variables
BackoffBase is the base amount of time to backoff (default: 5s).
BackoffCoef is the backoff coefficient (default: 1s).
BackoffMax is the maximum backoff time (default: 5m).
DefaultPerPeerRateLimit is the number of concurrent outbound dials to make per peer.
ErrAddrFiltered is returned when trying to register a connection to a filtered address.
ErrAllDialsFailed is returned when connecting to a peer has ultimately failed.
ErrConnClosed is returned when operating on a closed connection.
ErrDialBackoff is returned by the backoff code when a given peer has been dialed too frequently.
ErrDialRefusedBlackHole is returned when we are in a black holed environment.
ErrDialTimeout is returned when one a dial times out due to the global timeout.
ErrDialToSelf is returned if we attempt to dial our own peer.
ErrGaterDisallowedConnection is returned when the gater prevents us from forming a connection with a peer.
ErrNoAddresses is returned when we fail to find any addresses for a peer we're trying to dial.
ErrNoGoodAddresses is returned when we find addresses for a peer but can't use any of them.
ErrNoTransport is returned when we don't know a transport for the given multiaddr.
ErrQUICDraft29 wraps ErrNoTransport and provide a more meaningful error message.
ErrSwarmClosed is returned when one attempts to operate on a closed swarm.
# Structs
BlackHoleSuccessCounter provides black hole filtering for dials.
Conn is the connection type used by swarm.
DialBackoff is a type for tracking peer dial backoffs.
DialError is the error type returned when dialing.
Stream is the stream type used by swarm.
Swarm is a connection muxer, allowing connections to other peers to be opened and closed, while still using the same Chan for all communication.
TransportError is the error returned when dialing a specific address.
# Interfaces
Clock is a clock that can create timers that trigger at some instant rather than some duration.
InstantTimer is a timer that triggers at some instant rather than some duration.