scope property
Scope returns the user view of this connection's resource scope
Implementation
@override
ConnScope get scope {
// YamuxSession has its own _peerScope which might be more specific
// or fall back to the underlying connection's scope.
// The _peerScope is typically set via newConnOnTransport.
if (_peerScope != null) {
// This is tricky because PeerScope is not directly a ConnScope.
// ConnScope is an interface with methods like IncRef, Done, etc.
// PeerScope is a ResourceScope.
// For now, if _peerScope is set, we might need to adapt it or
// this indicates a mismatch in how scopes are handled at this level.
// Let's assume for now that if _peerScope is available, it's the one to use,
// but this might need a more robust adapter if ConnScope has methods not on PeerScope.
// A simpler approach: ConnScope is about managing the connection's lifecycle within rcmgr.
// The YamuxSession itself is scoped.
// The _connection (TransportConn) should have its own scope.
return _connection.scope;
}
return _connection.scope;
}