FutureSoket.fromSoket constructor

FutureSoket.fromSoket(
  1. Socket? _socket
)

Implementation

FutureSoket.fromSoket(this._socket) {
  _subscription = _socket
      ?.asyncExpand((bytes) => Stream.fromIterable(bytes))
      .listen(
        (_) {},
        onError: (_) async => await disconnect(),
        onDone: () async => await disconnect(),
      );
  _subscription?.pause();
}