RoutedHost class
RoutedHost is a p2p Host that includes a routing system. This allows the Host to find the addresses for peers when it does not have them.
- Implemented types
- Available extensions
Constructors
- RoutedHost.new(Host _host, PeerRouting _routing)
Properties
-
addrs
→ List<
MultiAddr> -
Addrs returns the listen addresses of the Host
no setteroverride
- connManager → ConnManager
-
ConnManager returns this hosts connection manager
no setteroverride
- eventBus → EventBus
-
EventBus returns the hosts eventbus
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- holePunchService → HolePunchService?
-
Returns the HolePunchService for this host, if available.
no setteroverride
- id → PeerId
-
ID returns the (local) peer.ID associated with this Host
no setteroverride
- mux → ProtocolSwitch
-
Mux returns the Mux multiplexing incoming streams to protocol handlers
no setteroverride
- network → Network
-
Network returns the Network interface of the Host
no setteroverride
- peerStore → Peerstore
-
Peerstore returns the Host's repository of Peer Addresses and Keys.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addStompService(
{StompServiceOptions? options}) → Future< StompService> -
Available on Host, provided by the StompHostExtension extension
Adds STOMP service to the host -
close(
) → Future< void> -
Close shuts down the host, its Network, and services.
override
-
connect(
AddrInfo pi, {Context? context}) → Future< void> -
Connect ensures there is a connection between this host and the peer with
given peer.ID. Connect will absorb the addresses in pi into its internal
peerstore. If there is not an active connection, Connect will issue a
h.Network.Dial, and block until a connection is open, or an error is
returned.
override
-
connectStomp(
{required PeerId peerId, required String hostName, String? login, String? passcode, Duration? timeout}) → Future< StompClient> -
Available on Host, provided by the StompHostExtension extension
Creates a STOMP client connection to a peer -
newStream(
PeerId p, List< ProtocolID> pids, Context context) → Future<P2PStream> -
NewStream opens a new stream to given peer p, and writes a p2p/protocol
header with given ProtocolID. If there is no connection to p, attempts
to create one. If ProtocolID is "", writes no header.
(Thread-safe)
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeStreamHandler(
ProtocolID pid) → void -
RemoveStreamHandler removes a handler on the mux that was set by
SetStreamHandler
override
-
setStreamHandler(
ProtocolID pid, StreamHandler handler) → void -
SetStreamHandler sets the protocol handler on the Host's Mux.
This is equivalent to:
host.Mux().SetHandler(proto, handler)
(Thread-safe)
override
-
setStreamHandlerMatch(
ProtocolID pid, bool match(ProtocolID), StreamHandler handler) → void -
SetStreamHandlerMatch sets the protocol handler on the Host's Mux
using a matching function for protocol selection.
override
-
start(
) → Future< void> -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited