RetransmittingMSock class
Subclass of MessageSocket that tracks what messages have been received, and retransmits ones that haven't been. Not SUPER robust, and not super efficient, but it's much better than nothing.
- Inheritance
-
- Object
- MessageSocket
- RetransmittingMSock
Constructors
Properties
Methods
-
close(
) → Future< void> -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
ping(
) → Future< void> -
This ping gets no pong. It relies on the behavior I've so far observed, that if you try to send
data on a broken connection, it times out after 30 seconds or so, flagging the connection as broken
(and aborting any read attempts in progress, btw). The data it sends is an 8 byte big endian -1,
which would otherwise indicate a subsequent message -1 bytes in length (but is discarded as a ping).
inherited -
recvBytes(
{int maxLen = 1000000, bool tryHard = true}) → Future< Uint8List?> -
Result of [] simply means an empty message; result of null implies some kind of failure; likely a disconnect.
//NEXT Update docs
override
-
recvString(
{bool? allowMalformed = true, int maxLen = 1000000, bool tryHard = true}) → Future< String?> -
inherited
-
sendBytes(
Uint8List data, {bool important = true}) → Future< bool> -
Send a message.
data
should be a list of bytes, or a string (which will then be encoded with utf-8.)
Throws exception on socket failure.
//DUMMY Doesn't throw. Just keeps going. Should probably fix that.
If notimportant
, and another message is currently being sent, returns false instead of sending the message.
Otherwise, returns true once message has been added to the sock.
override -
sendString(
String s, {bool important = true}) → Future< bool> -
See
sendBytes
inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- RETX_LIMIT → const int