WebRtcStream class
A libp2p stream over one data channel, with the libp2p WebRTC message framing (spec: webrtc/README.md#multiplexing) providing half-close and reset, which data channels lack.
Constructors
- WebRtcStream(RtcDataChannel _channel, Conn _conn, Direction direction)
Properties
- conn → Conn
-
Returns the connection this stream is part of
no setteroverride
- direction → Direction
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
incoming
→ P2PStream<
Uint8List> -
Returns a Dart Stream of the incoming data
no setteroverride
- isClosed → bool
-
Returns true if the stream is closed
no setteroverride
- isWritable → bool
-
Returns true if the stream is ready for writing
More precise than !isClosed as it excludes closing state
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> -
Closes the stream for both reading and writing
override
-
closeRead(
) → Future< void> -
Sends STOP_SENDING; further data from the remote is discarded.
override
-
closeWrite(
) → Future< void> -
Sends FIN and waits (bounded) for the remote's FIN_ACK, so data sent
before it is known to have arrived.
override
-
id(
) → String -
Returns an identifier that uniquely identifies this Stream within this
host, during this run. Stream IDs may repeat across restarts.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
protocol(
) → String -
Returns the protocol ID associated with this stream
override
-
pushData(
Uint8List bytes) → void -
Puts
bytesback at the front of the read queue, e.g. bytes that multistream-select read past the end of its negotiation.override -
read(
[int? maxLength]) → Future< Uint8List> -
Reads data from the stream
override
-
reset(
) → Future< void> -
Closes both ends of the stream
override
-
scope(
) → StreamManagementScope -
Returns the management view of this stream's resource scope
override
-
setDeadline(
DateTime? time) → Future< void> -
Sets a deadline for both reading and writing operations
override
-
setProtocol(
String id) → Future< void> -
Sets the protocol for this stream
override
-
setReadDeadline(
DateTime time) → Future< void> -
Sets a deadline for reading operations
override
-
setWriteDeadline(
DateTime time) → Future< void> -
Sets a deadline for writing operations
override
-
stat(
) → StreamStats -
Returns metadata pertaining to this stream
override
-
toString(
) → String -
A string representation of this object.
override
-
write(
List< int> data) → Future<void> -
Writes data to the stream
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited