ProfileableWebSocket class

A wrapper around WebSocket that instruments frame events.

Implemented types

Constructors

ProfileableWebSocket(WebSocket _socket)

Properties

buffer List<SocketEvent>
final
closeCode int?
The close code set when the WebSocket connection is closed. If there is no close code available this property will be null
no setteroverride
closeReason String?
The close reason set when the WebSocket connection is closed. If there is no close reason available this property will be null
no setteroverride
done Future
Return a future which is completed when the StreamSink is finished.
no setteroverride
extensions String
The extensions property is initially the empty string. After the WebSocket connection is established this string reflects the extensions used by the server.
no setteroverride
first Future
The first element of this stream.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isBroadcast bool
Whether this stream is a broadcast stream.
no setteroverride
isEmpty Future<bool>
Whether this stream contains any elements.
no setteroverride
last Future
The last element of this stream.
no setteroverride
length Future<int>
The number of elements in this stream.
no setteroverride
pingInterval Duration?
The interval between ping signals.
getter/setter pairoverride
protocol String?
The protocol property is initially the empty string. After the WebSocket connection is established the value is the subprotocol selected by the server. If no subprotocol is negotiated the value will remain null.
no setteroverride
readyState int
Returns the current state of the connection.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single Future
The single element of this stream.
no setteroverride

Methods

add(dynamic data) → void
Sends data on the WebSocket connection. The data in data must be either a String, or a List<int> holding bytes.
override
addError(Object error, [StackTrace? stackTrace]) → void
Adds an error to the sink.
override
addStream(Stream stream) Future<void>
Sends data from a stream on WebSocket connection. Each data event from stream will be send as a single WebSocket frame. The data from stream must be either Strings, or List<int>s holding bytes.
override
addUtf8Text(List<int> bytes) → void
Sends a text message with the text represented by bytes.
override
any(bool test(dynamic element)) Future<bool>
Checks whether test accepts any element provided by this stream.
override
asBroadcastStream({void onListen(StreamSubscription subscription)?, void onCancel(StreamSubscription subscription)?}) Stream
Returns a multi-subscription stream that produces the same events as this.
override
asyncExpand<E>(Stream<E>? convert(dynamic event)) Stream<E>
Transforms each element into a sequence of asynchronous events.
override
asyncMap<E>(FutureOr<E> convert(dynamic event)) Stream<E>
Creates a new stream with each data event of this stream asynchronously mapped to a new event.
override
cast<R>() Stream<R>
Adapt this stream to be a Stream<R>.
override
close([int? code, String? reason]) Future<void>
Closes the WebSocket connection. Set the optional code and reason arguments to send close information to the remote peer. If they are omitted, the peer will see WebSocketStatus.noStatusReceived code with no reason.
override
contains(Object? needle) Future<bool>
Returns whether needle occurs in the elements provided by this stream.
override
distinct([bool equals(dynamic previous, dynamic next)?]) Stream
Skips data events if they are equal to the previous data event.
override
drain<E>([E? futureValue]) Future<E>
Discards all data on this stream, but signals when it is done or an error occurred.
override
elementAt(int index) Future
Returns the value of the indexth data event of this stream.
override
every(bool test(dynamic element)) Future<bool>
Checks whether test accepts all elements provided by this stream.
override
expand<S>(Iterable<S> convert(dynamic element)) Stream<S>
Transforms each element of this stream into a sequence of elements.
override
firstWhere(bool test(dynamic element), {dynamic orElse()?}) Future
Finds the first element of this stream matching test.
override
fold<S>(S initialValue, S combine(S previous, dynamic element)) Future<S>
Combines a sequence of values by repeatedly applying combine.
override
forEach(void action(dynamic element)) Future
Executes action on each element of this stream.
override
handleError(Function onError, {bool test(dynamic error)?}) Stream
Creates a wrapper Stream that intercepts some errors from this stream.
override
join([String separator = '']) Future<String>
Combines the string representation of elements into a single string.
override
lastWhere(bool test(dynamic element), {dynamic orElse()?}) Future
Finds the last element in this stream matching test.
override
listen(void onData(dynamic)?, {Function? onError, void onDone()?, bool? cancelOnError}) StreamSubscription
Adds a subscription to this stream.
override
map<S>(S convert(dynamic event)) Stream<S>
Transforms each element of this stream into a new stream event.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pipe(StreamConsumer streamConsumer) Future
Pipes the events of this stream into streamConsumer.
override
reduce(dynamic combine(dynamic combined, dynamic element)) Future
Combines a sequence of values by repeatedly applying combine.
override
singleWhere(bool test(dynamic element), {dynamic orElse()?}) Future
Finds the single element in this stream matching test.
override
skip(int count) Stream
Skips the first count data events from this stream.
override
skipWhile(bool test(dynamic element)) Stream
Skip data events from this stream while they are matched by test.
override
take(int count) Stream
Provides at most the first count data events of this stream.
override
takeWhile(bool test(dynamic element)) Stream
Forwards data events while test is successful.
override
timeout(Duration timeLimit, {void onTimeout(EventSink sink)?}) Stream
Creates a new stream with the same events as this stream.
override
toList() Future<List>
Collects all elements of this stream in a List.
override
toSet() Future<Set>
Collects the data of this stream in a Set.
override
toString() String
A string representation of this object.
inherited
transform<S>(StreamTransformer<dynamic, S> streamTransformer) Stream<S>
Applies streamTransformer to this stream.
override
where(bool test(dynamic event)) Stream
Creates a new stream from this stream that discards some elements.
override

Operators

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