send method

  1. @override
Future<void> send(
  1. JsonMap message
)
override

Sends message to the peer.

Completes when the message has been handed to the underlying channel, not when the peer has acted on it.

Implementation

@override
Future<void> send(JsonMap message) async {
  if (_disposed) {
    throw InvalidStateException(
      'The stdio transport `$name` has been disposed.',
      currentState: 'disposed',
      expectedState: 'open',
    );
  }
  _start();
  _process.stdin.writeln(jsonEncode(message));
  await _process.stdin.flush();
}