openNetworkStream method

Future<NetworkStream> openNetworkStream(
  1. String addr,
  2. TopicId topicId
)
inherited

Opens a raw byte streams to the given peer, bound to the given topic.

Implementation

Future<NetworkStream> openNetworkStream(
  String addr,
  TopicId topicId,
) async {
  final request = RequestSessionOpenNetworkStream(
    addr: addr,
    topicId: topicId,
  );
  final response = await client.invoke(request);
  switch (response) {
    case ResponseNetworkStream(value: final value): return NetworkStream(client, value);
    default: throw UnexpectedResponse();
  }
}