close method

  1. @override
void close()
override

Closed the connection.

Implementation

@override
void close() {
  connecting = false;
  messageHandler = null;
  onError = onDone = null;
  if (messageSubscription != null) {
    messageSubscription.cancel();
    messageSubscription = null;
  }
  if (socket != null) {
    socket.close();
    socket = null;
  }
}