MCPcopy
hub / github.com/mongodb/node-mongodb-native / connect

Method connect

src/sdam/server.ts:233–249  ·  view source on GitHub ↗

* Initiate server connect

()

Source from the content-addressed store, hash-verified

231 * Initiate server connect
232 */
233 connect(): void {
234 if (this.s.state !== STATE_CLOSED) {
235 return;
236 }
237
238 stateTransition(this, STATE_CONNECTING);
239
240 // If in load balancer mode we automatically set the server to
241 // a load balancer. It never transitions out of this state and
242 // has no monitor.
243 if (!this.loadBalanced) {
244 this.monitor?.connect();
245 } else {
246 stateTransition(this, STATE_CONNECTED);
247 this.emit(Server.CONNECT, this);
248 }
249 }
250
251 closeCheckedOutConnections() {
252 return this.pool.closeCheckedOutConnections();

Callers 15

createAndConnectServerFunction · 0.95
runFunction · 0.45
runCmapTestSuiteFunction · 0.45
waitUntilPoolsFilledFunction · 0.45
configureFailPointFunction · 0.45
clearFailPointFunction · 0.45
helloMethod · 0.45
runUnifiedTestFunction · 0.45
enableFailPointMethod · 0.45
disableFailPointsMethod · 0.45
createEntitiesMethod · 0.45
beforeEachFilterFunction · 0.45

Calls 1

emitMethod · 0.65

Tested by 11

setupFunction · 0.36
testFunction · 0.36
makeTestFunction · 0.36
testFunction · 0.36
defineTestFunction · 0.36
deadlockTestFunction · 0.36
defineCorpusTestsFunction · 0.36
testFunction · 0.36
clientConnectFunction · 0.36
makeAndConnectReplSetFunction · 0.36
runSrvPollerTestFunction · 0.36