BaseWebSocketAckableServer<C extends WebSocketAckableClient, T extends AckableRoom<C> > class
abstract
A broadcaster that generates a simple websocket server through shelf_web_socket
- Inheritance
-
- Object
- AckableRoom<
AckableClient> - AckableBroadcaster
- BaseWebSocketAckableServer
- Implemented types
- Implementers
Constructors
- BaseWebSocketAckableServer(String name, {Object? host, int? port = 8080})
-
nameis used to identify the server.hostis the IP or the InternetAddress to bind the server.portis the port to bind the host.
Properties
- caster → AckableBroadcaster?
-
finalinherited
-
clients
→ Set<
AckableClient> -
no setterinherited
-
delegate
→ Set<
AckableClient> -
no setterinherited
- first → AckableClient
-
The first element.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → Object?
-
The IP or the InternetAddress to bind the server.
no setter
- isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
AckableClient> -
A new
Iteratorthat allows iterating the elements of thisIterable.no setterinherited - last → AckableClient
-
The last element.
no setterinherited
- length → int
-
The number of elements in this Iterable.
no setterinherited
- name → String
-
no setterinherited
-
onClient
→ Stream<
C> -
no setteroverride
- port → int?
-
The port to bind the host.
final
-
rooms
→ Map<
String, AckableRoom< AckableClient> > -
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → AckableClient
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
Methods
-
add(
AckableClient value) → bool -
Adds
valueto the set.inherited -
addAll(
Iterable< AckableClient> elements) → void -
Adds all
elementsto this set.inherited -
any(
bool test(AckableClient element)) → bool -
Checks whether any element of this iterable satisfies
test.inherited -
broadcaster<
T> ({FutureOr< void> onCancel()?}) → StreamController<T> -
Creates a StreamController.broadcast that is closed within
dispose.inherited -
cancelBind(
Symbol key) → Future< bool> -
inherited
-
cancelBindings(
) → Future< void> -
Cancel all active listeners, timers and close the controllers.
This does not dispose other disposables bound with
bind.inherited -
cancelTimer(
Symbol key) → bool -
inherited
-
cancelUnique(
Symbol id) → Future< void> -
inherited
-
cancelUniques(
Set< Symbol> ids) → Future<void> -
inherited
-
cast<
T> () → DelegatingSet< T> -
A view of this iterable as an iterable of
Rinstances.inherited -
checkHeart(
) → FutureOr< bool> -
clear(
) → void -
Removes all elements from the set.
inherited
-
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element.inherited -
containsAll(
Iterable< Object?> other) → bool -
Whether this set contains all the elements of
other.inherited -
controller<
T> ({bool broadcast = false, FutureOr< void> onCancel()?}) → StreamController<T> -
Creates a StreamController that is closed within
dispose.inherited -
difference(
Set< Object?> other) → Set<AckableClient> -
Creates a new set with the elements of this that are not in
other.inherited -
disposable(
Disposable disposable) → void -
Binds another
Disposableobject to be disposed when this is disposed.inherited -
dispose(
) → Future< void> -
Cancel all active listeners, timers, close the controllers
and disposes other disposables bound with
bind.override -
each<
T> (Stream< T> stream, void fn(T item), {Symbol? uniqueId}) → StreamSubscription<T> -
Listens and iterates through
streamby callingfn. The listener is disposed in thedisposefunction.inherited -
elementAt(
int index) → AckableClient -
Returns the
indexth element.inherited -
every(
bool test(AckableClient element)) → bool -
Checks whether every element of this iterable satisfies
test.inherited -
expand<
T> (Iterable< T> f(AckableClient element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
firstWhere(
bool test(AckableClient element), {AckableClient orElse()?}) → AckableClient -
The first element that satisfies the given predicate
test.inherited -
fold<
T> (T initialValue, T combine(T previousValue, AckableClient element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< AckableClient> other) → Iterable<AckableClient> -
Creates the lazy concatenation of this iterable and
other.inherited -
forEach(
void f(AckableClient element)) → void -
Invokes
actionon each element of this iterable in iteration order.inherited -
intersection(
Set< Object?> other) → Set<AckableClient> -
Creates a new set which is the intersection between this set and
other.inherited -
interval(
Duration duration, dynamic fn(Timer), {Symbol? uniqueId, bool execNow = true}) → Timer -
inherited
-
join(
[String separator = '']) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(AckableClient element), {AckableClient orElse()?}) → AckableClient -
The last element that satisfies the given predicate
test.inherited -
lookup(
Object? object) → AckableClient? -
If an object equal to
objectis in the set, return it.inherited -
makeClient(
WebSocketChannel wsc) → FutureOr< C> -
makeRoom(
String name) → FutureOr< AckableRoom< AckableClient> > -
inherited
-
map<
T> (T f(AckableClient e)) → Iterable< T> -
The current elements of this iterable modified by
toElement.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
periodic(
Duration duration, dynamic fn(Timer), {Symbol? uniqueId}) → Timer -
Creates a periodic Timer.periodic that gets cancelled within
dispose.inherited -
reduce(
AckableClient combine(AckableClient value, AckableClient element)) → AckableClient -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
remove(
Object? value) → bool -
Removes
valuefrom the set.inherited -
removeAll(
Iterable< Object?> elements) → void -
Removes each element of
elementsfrom this set.inherited -
removeWhere(
bool test(AckableClient element)) → void -
Removes all elements of this set that satisfy
test.inherited -
retainAll(
Iterable< Object?> elements) → void -
Removes all elements of this set that are not elements in
elements.inherited -
retainWhere(
bool test(AckableClient element)) → void -
Removes all elements of this set that fail to satisfy
test.inherited -
reusable(
) → Disposable -
inherited
-
room(
String name) → Future< AckableRoom< AckableClient> ?> -
inherited
-
shout(
String subject, Object? data, {Map< String, Object> ? headers}) → void -
inherited
-
singleWhere(
bool test(AckableClient element), {AckableClient orElse()?}) → AckableClient -
The single element that satisfies
test.inherited -
skip(
int n) → Iterable< AckableClient> -
Creates an Iterable that provides all but the first
countelements.inherited -
skipWhile(
bool test(AckableClient value)) → Iterable< AckableClient> -
Creates an
Iterablethat skips leading elements whiletestis satisfied.inherited -
start(
) → Future< HttpServer> - Starts the websocket server.
-
streamedInterval<
T, E> (Stream< T> valueStream, Duration duration, dynamic fn(T?), {Symbol? uniqueId}) → StreamedIntervalTimer -
inherited
-
take(
int n) → Iterable< AckableClient> -
Creates a lazy iterable of the
countfirst elements of this iterable.inherited -
takeFirst<
T> (Stream< T> stream) → Future<T> -
inherited
-
takeWhile(
bool test(AckableClient value)) → Iterable< AckableClient> -
Creates a lazy iterable of the leading elements satisfying
test.inherited -
talk(
String subject, Object? data, {Future onAck(AckableClient, AckedMessage)?, Map< String, Object> ? headers}) → Future<void> -
inherited
-
timer(
Duration duration, dynamic fn()) → Timer -
Creates a Timer that gets cancelled within
disposeif not executed.inherited -
toList(
{bool growable = true}) → List< AckableClient> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< AckableClient> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
union(
Set< AckableClient> other) → Set<AckableClient> -
Creates a new set which contains all the elements of this set and
other.inherited -
uniqueEach<
T> (Symbol id, Stream< T> stream, void fn(T item)) → StreamSubscription<T> -
Listens and iterates through
streamby callingfn. The listener is disposed in thedisposefunction.inherited -
uniqueListen(
Symbol id, ChangeNotifier obj, void fn()) → void -
Listens and iterates through
obj.addListenerby callingfn. The listener is disposed in thedisposefunction.inherited -
uniqueTimer(
Symbol uniqueId, Duration duration, dynamic fn()) → Timer -
Creates a Timer that gets cancelled within
disposeif not executed.inherited -
where(
bool test(AckableClient element)) → Iterable< AckableClient> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test.inherited -
whereType<
T> () → Iterable< T> -
Creates a new lazy Iterable with all elements that have type
T.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited