P2PStreamAdapter constructor

P2PStreamAdapter(
  1. MuxedStream _underlyingMuxedStream,
  2. TCPConnection _parentConnection,
  3. StreamManagementScope _streamManagementScope,
  4. Direction _direction,
  5. String _protocolId,
)

Implementation

P2PStreamAdapter(
  this._underlyingMuxedStream,
  this._parentConnection,
  this._streamManagementScope,
  this._direction, // Added direction
  this._protocolId,
) : _id = Uuid().v4() { // Initialize unique ID
  _incomingDataController = StreamController<Uint8List>(
    onListen: _startListening,
    onCancel: _stopListening,
  );
}