Peer class
Methods
-
clearHandlers()
→ Future<void>
-
clear all handlers of any event type and clear theme from memory
inherited
-
completeCompleters()
→ void
-
complete all
onNextEmit
completers and clear them from memory
inherited
-
connect()
→ Future<void>
-
start connection to the peer and handle events
-
destroy()
→ Future<void>
-
destroy the current peer connection
override
-
disconnect()
→ void
-
flush data, disconnect peer and close socket then clear memory
-
emit<E extends T>(E event)
→ void
-
emit
event
inherited
-
filteredStream<E extends T>()
→ Stream<E>
-
filter events stream for specific sub event type
E
inherited
-
handle<E extends T>(EventHandler<E> handler)
→ HandlerCanceler
-
handle events of type
E
with handler
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
on({void connect()?, void disconnect()?, void data(Uint8List data)?, void message(Message message)?, void sendData(Uint8List data)?, void sendMessage(Message message)?, void error(String message, Object error, StackTrace stackTrace)?})
→ void
-
handle all events emitted by the peer
-
onMessage<T extends Message>(void handler(T message))
→ void
-
handle messages with specific type
T
-
onNextEmit<E extends T>()
→ Future<void>
-
return
Future
that completes on the next event emitted of type E
inherited
-
send(Uint8List data)
→ bool
-
send
data
to the peer and returns true if succeeded
-
sendBytes(List<int> bytes)
→ bool
-
send
bytes
to the peer and returns true if succeeded
-
sendMessage(Message message)
→ bool
-
send
message
to the peer and returns true if succeeded
-
sendText(String text)
→ bool
-
send
text
to the peer and returns true if succeeded
-
toString()
→ String
-
returns peer's info with
~
at the end if peer is connected as a String
override