send method

  1. @override
Future<void> send(
  1. PeerId to,
  2. Frame frame
)

Sends frame to the peer identified by to.

Implementation

@override
Future<void> send(PeerId to, Frame frame) async {
  final conn = _connections[to];
  if (conn == null) return;
  conn.add(FrameCodec.encode(frame));
}