subscribe method

Socket subscribe(
  1. String channel, [
  2. AckCall? ack
])

Implementation

Socket subscribe(String channel, [AckCall? ack]) {
  int count = ++_counter;
  var message = {
    'event': '#subscribe',
    'data': {'channel': channel},
    'cid': count
  };
  if (ack != null) _acks[count] = getAckObject(channel, ack);
  var json = jsonEncode(message);
  sendOrAdd(json);
  return this;
}