Peer class

Inheritance
  • Object
  • StreamEventEmitter
  • Peer

Constructors

Peer({String? id, PeerOptions? options})

Properties

controller StreamController<Event>
finalinherited
destroyed bool
no setter
disconnected bool
no setter
hashCode int
The hash code for this object.
no setterinherited
id String?
no setter
open bool
no setter
options PeerOptions
no setter
path String?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
socket → Socket
no setter

Methods

call(String peer, MediaStream stream, {CallOption? options}) MediaConnection
close() → void
Closes the event emitter, which closes all the listeners in the process.
inherited
connect(String peer, {PeerConnectOption? options}) DataConnection
disconnect() → void
Disconnects the Peer's connection to the PeerServer. Does not close any active connections. Warning: The peer can no longer create or accept connections after being disconnected. It also cannot reconnect to the server.
dispose() → void
emit<T>(String type, T data) → void
Emit a event with a specific event type and data type. This will broadcast the message to all listeners that match the same event type and data type.
inherited
emitError(PeerErrorType type, dynamic err) → void
emitEvent<T>(Event<T> event) → void
Emit a message on a specific event type and data type. This will broadcast the event to all listeners that match the same event type and data type.
inherited
getConnection(String peerId, String connectionId) → dynamic
Retrieve a data/media connection for this peer. */
getMessages(String connectionId) List<ServerMessage>
Stores messages without a set up connection, to be claimed later. */
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on<T>([String? type]) Stream<T>
Attach a listener to the event emitter. Calls the callback whenever there's a new event of the specified type and data type.
inherited
onAny<MessageType>() Stream<Event<MessageType>>
inherited
once<T>([String? type]) Future<T>
Same as on but only running once, by returning a Future.
inherited
onceEvent<T extends Event>([String? type]) Future<T>
Same as onEvent but only running once, by returning a Future.
inherited
onEvent<T extends Event>([String? type]) Stream<T>
Attach a listener to an emitter. Calls the callback whenever there's a new event of the specified type and data type.
inherited
reconnect() → void
Attempts to reconnect with the same ID. */
removeConnection(dynamic connection) → void
connection: DataConnection / MediaConnection
toString() String
A string representation of this object.
inherited

Operators

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