MCPcopy Create free account
hub / github.com/defold/defold / ConnectionPool

Method ConnectionPool

engine/dlib/src/dlib/connection_pool.cpp:77–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75 uint16_t m_AllowNewConnections:1;
76
77 ConnectionPool(const Params* params)
78 {
79 uint32_t max_connections = params->m_MaxConnections;
80 m_MaxKeepAlive = params->m_MaxKeepAlive;
81 m_Mutex = dmMutex::New();
82
83 m_Connections.SetCapacity(max_connections);
84 m_Connections.SetSize(max_connections);
85
86 for (uint32_t i = 0; i < max_connections; ++i) {
87 m_Connections[i].Clear();
88 }
89
90 m_NextVersion = 0;
91
92 // This is to block new connections when shutting down the pool.
93 m_AllowNewConnections = 1;
94 }
95
96 ~ConnectionPool()
97 {

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
SetCapacityMethod · 0.45
SetSizeMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected