send method

Future<void> send(
  1. String connectionId,
  2. String data
)

Send message data to a connection, referenced by its connectionId.

Implementation

Future<void> send(String connectionId, String data) async {
  var req = $wp.WebsocketSendRequest(
      socketName: name, connectionId: connectionId, data: utf8.encode(data));
  await ClientChannelSingleton.useClient($wp.WebsocketClient.new,
      (client) async => await client.sendMessage(req));
}