Network class abstract

Network is the interface used to connect to the outside world. It dials and listens for connections. it uses a Swarm to pool connections. Connections are encrypted with a TLS-like protocol.

Implemented types
Implementers

Constructors

Network.new()

Properties

conns List<Conn>
Returns the connections in this Network
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
interfaceListenAddresses Future<List<MultiAddr>>
Returns a list of addresses at which this network listens. It expands "any interface" addresses (/ip4/0.0.0.0, /ip6/::) to use the known local interfaces.
no setter
listenAddresses List<MultiAddr>
Returns a list of addresses at which this network listens.
no setter
localPeer PeerId
Returns the local peer associated with this network
no setterinherited
peers List<PeerId>
Returns the peers connected
no setterinherited
peerstore Peerstore
Returns the internal peerstore This is useful to tell the dialer about a new address for a peer. Or use one of the public keys found out over the network.
no setterinherited
resourceManager ResourceManager
Returns the ResourceManager associated with this network
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canDial(PeerId peerId, MultiAddr addr) bool
Returns whether the dialer can dial peer p at addr
inherited
close() Future<void>
Closes the network
closePeer(PeerId peerId) Future<void>
Closes the connection to a given peer
inherited
connectedness(PeerId peerId) Connectedness
Returns a state signaling connection capabilities
inherited
connsToPeer(PeerId peerId) List<Conn>
Returns the connections in this Network for given peer.
inherited
dialPeer(Context context, PeerId peerId) Future<Conn>
Establishes a connection to a given peer
inherited
listen(List<MultiAddr> addrs) Future<void>
Tells the network to start listening on given multiaddrs.
newStream(Context context, PeerId peerId) Future<P2PStream>
Returns a new stream to given peer p. If there is no connection to p, attempts to create one.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify(Notifiee notifiee) → void
Register a notifiee for signals
inherited
removeListenAddress(MultiAddr addr) → void
inherited
setStreamHandler(String protocol, Future<void> handler(dynamic stream, PeerId remotePeer)) → void
Sets the handler for new streams opened by the remote side. This operation is thread-safe.
stopNotify(Notifiee notifiee) → void
Unregister a notifiee for signals
inherited
toString() String
A string representation of this object.
inherited

Operators

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