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

Function makeConnection

src/cmap/connect.ts:56–63  ·  view source on GitHub ↗
(options: ConnectionOptions, socket: Stream)

Source from the content-addressed store, hash-verified

54}
55
56export function makeConnection(options: ConnectionOptions, socket: Stream): Connection {
57 let ConnectionType = options.connectionType ?? Connection;
58 if (options.autoEncrypter) {
59 ConnectionType = CryptoConnection;
60 }
61
62 return new ConnectionType(socket, options);
63}
64
65function checkSupportedServer(hello: Document, options: ConnectionOptions) {
66 const maxWireVersion = Number(hello.maxWireVersion);

Callers 2

checkServerFunction · 0.90
connectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected