handleMessage method

void handleMessage (ByteData data)

Handle a control message.

This is intended to be called by the platform messages dispatcher.

Available messages:

  • Name: resize Arity: 2 Format: resize\r<channel name>\r<new size> Description: Allows you to set the size of a channel's buffer.

Implementation

void handleMessage(ByteData data) {
  final List<String> command = _getString(data).split('\r');
  if (command.length == /*arity=*/2 + 1 && command[0] == 'resize') {
    _resize(command[1], int.parse(command[2]));
  } else {
    throw Exception('Unrecognized command $command sent to $kControlChannelName.');
  }
}