Documentation ¶
Overview ¶
Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/p2p/net/swarm.
Index ¶
Constants ¶
const ConcurrentFdDials = swarm.ConcurrentFdDials
ConcurrentFdDials is the number of concurrent outbound dials over transports that consume file descriptors Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ConcurrentFdDials instead.
const DefaultPerPeerRateLimit = swarm.DefaultPerPeerRateLimit
DefaultPerPeerRateLimit is the number of concurrent outbound dials to make per peer Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.DefaultPerPeerRateLimit instead.
const DialAttempts = swarm.DialAttempts
DialAttempts governs how many times a goroutine will try to dial a given peer. Note: this is down to one, as we have _too many dials_ atm. To add back in, add loop back in Dial(.) Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.DialAttempts instead.
Variables ¶
var ( // ErrDialBackoff is returned by the backoff code when a given peer has // been dialed too frequently // Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrDialBackoff instead. ErrDialBackoff = swarm.ErrDialBackoff // ErrDialToSelf is returned if we attempt to dial our own peer // Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrDialToSelf instead. ErrDialToSelf = swarm.ErrDialToSelf // ErrNoTransport is returned when we don't know a transport for the // given multiaddr. // Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrNoTransport instead. ErrNoTransport = swarm.ErrNoTransport // ErrAllDialsFailed is returned when connecting to a peer has ultimately failed // Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrAllDialsFailed instead. ErrAllDialsFailed = swarm.ErrAllDialsFailed // ErrNoAddresses is returned when we fail to find any addresses for a // peer we're trying to dial. // Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrNoAddresses instead. ErrNoAddresses = swarm.ErrNoAddresses // ErrNoGoodAddresses is returned when we find addresses for a peer but // can't use any of them. // Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrNoGoodAddresses instead. ErrNoGoodAddresses = swarm.ErrNoGoodAddresses // ErrGaterDisallowedConnection is returned when the gater prevents us from // forming a connection with a peer. // Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrGaterDisallowedConnection instead. ErrGaterDisallowedConnection = swarm.ErrGaterDisallowedConnection )
var BackoffBase = swarm.BackoffBase
BackoffBase is the base amount of time to backoff (default: 5s). Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.BackoffBase instead.
var BackoffCoef = swarm.BackoffCoef
BackoffCoef is the backoff coefficient (default: 1s). Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.BackoffCoef instead.
var BackoffMax = swarm.BackoffMax
BackoffMax is the maximum backoff time (default: 5m). Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.BackoffMax instead.
var ErrAddrFiltered = swarm.ErrAddrFiltered
ErrAddrFiltered is returned when trying to register a connection to a filtered address. You shouldn't see this error unless some underlying transport is misbehaving. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrAddrFiltered instead.
var ErrConnClosed = swarm.ErrConnClosed
ErrConnClosed is returned when operating on a closed connection. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrConnClosed instead.
var ErrDialTimeout = swarm.ErrDialTimeout
ErrDialTimeout is returned when one a dial times out due to the global timeout Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrDialTimeout instead.
var ErrSwarmClosed = swarm.ErrSwarmClosed
ErrSwarmClosed is returned when one attempts to operate on a closed swarm. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.ErrSwarmClosed instead.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn is the connection type used by swarm. In general, you won't use this type directly. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.Conn instead.
type DialBackoff ¶
type DialBackoff = swarm.DialBackoff
DialBackoff is a type for tracking peer dial backoffs.
* It's safe to use its zero value. * It's thread-safe. * It's *not* safe to move this type after using. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.DialBackoff instead.
type DialError ¶ added in v0.0.3
DialError is the error type returned when dialing. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.DialError instead.
type Option
deprecated
added in
v0.6.0
Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.Option instead.
func WithConnectionGater ¶ added in v0.6.0
func WithConnectionGater(gater connmgr.ConnectionGater) Option
WithConnectionGater sets a connection gater Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.WithConnectionGater instead.
func WithDialTimeout
deprecated
added in
v0.10.0
func WithDialTimeoutLocal
deprecated
added in
v0.10.0
func WithMetrics ¶ added in v0.6.0
WithMetrics sets a metrics reporter Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.WithMetrics instead.
func WithResourceManager
deprecated
added in
v0.10.0
func WithResourceManager(m network.ResourceManager) Option
Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.WithResourceManager instead.
type Stream ¶
Stream is the stream type used by swarm. In general, you won't use this type directly. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.Stream instead.
type 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. The Chan sends/receives Messages, which note the destination or source Peer. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.Swarm instead.
type TransportError ¶ added in v0.0.3
type TransportError = swarm.TransportError
TransportError is the error returned when dialing a specific address. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm.TransportError instead.