ConnectionManager class

Constructors

ConnectionManager(Db db, {bool lastMasterSupportsOpMsg = false, bool lastMasterSupportsListCollections = false, bool lastMasterSupportsListIndexes = false})

Properties

db → Db
final
hasAnyConnectedServer → bool
Indicates whether at least one pooled host still has an open socket. This mirrors the Java driver SDAM approach: keep monitoring/promotion active before tearing down the whole topology.
no setter
hasAnyReadyServer → bool
no setter
hashCode → int
The hash code for this object.
no setterinherited
masterConnection → Connection?
no setter
masterConnectionVerified → Connection
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
supportsListCollections → bool
no setter
supportsListIndexes → bool
no setter
supportsOpMsg → bool
no setter

Methods

addConnection(ServerConfig serverConfig) → Connection
close({Object? error}) → Future
debugAddConnection(Connection connection) → void
Visible for testing: seeds a specific connection into the host pool.
debugConnectionCountForHost(String hostUrl) → int
Visible for testing: reports pooled connection count for a host.
debugHostContainsConnection(Connection connection) → bool
Visible for testing: reports whether a specific connection is still tracked.
debugSetMasterConnection(Connection? connection) → void
Visible for testing: overrides the current primary connection.
handleSocketError(Connection failedConnection, ConnectionException exception) → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open(WriteConcern writeConcern) → Future<void>
refreshTopology() → Future<void>
removeConnection(Connection connection) → Connection?
selectOperationalConnection({bool requireAuthentication = true}) → Connection
Selects an authenticated, connected socket from the current primary host. This provides per-host operation distribution while preserving primary routing semantics.
toString() → String
A string representation of this object.
inherited
waitForMaster({required Duration timeout}) → Future<Connection?>

Operators

operator ==(Object other) → bool
The equality operator.
inherited