pauldemarco / socketcluster_client

SocketCluster.io Client for Dart
BSD 3-Clause "New" or "Revised" License
12 stars 10 forks source link

How to disconnect from the server? #8

Closed opensourcegps closed 5 years ago

opensourcegps commented 5 years ago

How to disconnect from the server? Some hints about the implementation would be great.

Does not work:

 static Future<Socket> disconnect() async {

    //does not work
    // _socket.close();
    //_socket.sink.close();

   // return _socket.close();

  }
opensourcegps commented 5 years ago

Got it working with this:

  close_socket() async {

    print('Disconnecting chat socket');
    _socket.close();

  }