DirectPacketFactory class

Creates and parses direct packets (B=0, client <-> client).

Only carries the ten instructions that make sense off-relay: handshake, heartbeat, shutdown, noop and data. It never includes acpt/deny/fail/done, which only exist on the server side.

Inheritance

Constructors

DirectPacketFactory()
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

ack(Uint8List? response) → DirectPacket
3rd handshake (ACK!, A=1): final acknowledgment of the session.
copy(Magpie packet, [Uint8List? response]) → DirectPacket
Reply (COPY, A=1): acknowledge a received DATA packet.
data(Uint8List payload, {required int sn, int index = 0, int count = 1}) → DirectPacket
Ordinary data packet (peer -> peer).
fin(Uint8List? request) → DirectPacket
Shutdown (FIN?): close the peer-to-peer session.
finAck(Magpie packet, [Uint8List? response]) → DirectPacket
Reply (FIN!, A=1): confirm a peer's FIN shutdown request.
noop(Uint8List? request) → DirectPacket
No-op (NOOP): keep the channel warm.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(Uint8List buffer) → Packet?
Validate and parse a received direct datagram.
override
ping(Uint8List? request) → DirectPacket
Heartbeat (PING): keep-alive between peers.
pong(Magpie packet, [Uint8List? response]) → DirectPacket
Reply (PONG, A=1): answer a peer's PING.
syn(Uint8List? request) → DirectPacket
1st handshake (SYN?): propose a peer-to-peer session.
synAck(Uint8List? response) → DirectPacket
2nd handshake (SYN!, A=1): accept the peer's proposal.
toString() → String
A string representation of this object.
inherited

Operators

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