Documentation ¶
Index ¶
- Variables
- type Option
- type TcpTransport
- func (t *TcpTransport) CanDial(addr ma.Multiaddr) bool
- func (t *TcpTransport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (transport.CapableConn, error)
- func (t *TcpTransport) DialWithUpdates(ctx context.Context, raddr ma.Multiaddr, p peer.ID, ...) (transport.CapableConn, error)
- func (t *TcpTransport) Listen(laddr ma.Multiaddr) (transport.Listener, error)
- func (t *TcpTransport) Protocols() []int
- func (t *TcpTransport) Proxy() bool
- func (t *TcpTransport) String() string
- func (t *TcpTransport) UseReuseport() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ReuseportIsAvailable = tcpreuse.ReuseportIsAvailable
Deprecated: Use tcpreuse.ReuseportIsAvailable
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*TcpTransport) error
func DisableReuseport ¶
func DisableReuseport() Option
func WithConnectionTimeout ¶
func WithMetrics ¶ added in v0.23.0
func WithMetrics() Option
type TcpTransport ¶
type TcpTransport struct {
// contains filtered or unexported fields
}
TcpTransport is the TCP transport.
func NewTCPTransport ¶
func NewTCPTransport(upgrader transport.Upgrader, rcmgr network.ResourceManager, sharedTCP *tcpreuse.ConnMgr, opts ...Option) (*TcpTransport, error)
NewTCPTransport creates a tcp transport object that tracks dialers and listeners created.
func (*TcpTransport) CanDial ¶
func (t *TcpTransport) CanDial(addr ma.Multiaddr) bool
CanDial returns true if this transport believes it can dial the given multiaddr.
func (*TcpTransport) Dial ¶
func (t *TcpTransport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (transport.CapableConn, error)
Dial dials the peer at the remote address.
func (*TcpTransport) DialWithUpdates ¶ added in v0.32.0
func (t *TcpTransport) DialWithUpdates(ctx context.Context, raddr ma.Multiaddr, p peer.ID, updateChan chan<- transport.DialUpdate) (transport.CapableConn, error)
func (*TcpTransport) Protocols ¶
func (t *TcpTransport) Protocols() []int
Protocols returns the list of terminal protocols this transport can dial.
func (*TcpTransport) Proxy ¶
func (t *TcpTransport) Proxy() bool
Proxy always returns false for the TCP transport.
func (*TcpTransport) String ¶
func (t *TcpTransport) String() string
func (*TcpTransport) UseReuseport ¶
func (t *TcpTransport) UseReuseport() bool
UseReuseport returns true if reuseport is enabled and available.
Click to show internal directories.
Click to hide internal directories.