ConnGater class abstract

ConnGater can be implemented by a type that supports active inbound or outbound Conn gating.

ConnGaters are active, whereas ConnManagers tend to be passive.

A ConnGater will be consulted during different states in the lifecycle of a Conn being established/upgraded. Specific functions will be called throughout the process, to allow you to intercept the Conn at that stage.

This interface can be used to implement strict/active Conn management policies, such as hard limiting of Conns once a maximum count has been reached, maintaining a peer blacklist, or limiting Conns by transport quotas.

Implementers

Constructors

ConnGater.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

interceptAccept(Conn conn) bool
Tests whether an incipient inbound Conn is allowed.
interceptAddrDial(PeerId peerId, MultiAddr addr) bool
Tests whether we're permitted to dial the specified multiaddr for the given peer.
interceptPeerDial(PeerId peerId) bool
Tests whether we're permitted to Dial the specified peer.
interceptSecured(bool isInitiator, PeerId peerId, Conn conn) bool
Tests whether a given Conn, now authenticated, is allowed.
interceptUpgraded(Conn conn) → (bool, DisconnectReason?)
Tests whether a fully capable Conn is allowed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited