connect method

void connect ()

Implementation

void connect() {
  webSocketChannel = IOWebSocketChannel.connect(url, protocols: protocols);
  // this?.onOpen();
  webSocketChannel.stream.listen((message) {
    this.onMessage(message);
  }, onError: (error) {
    this.onError(100, error);
  }, onDone: () {
    this.onClose(0, "Websocket closed.");
  });
}