|
MongoDB
2.4.4-pre-
|
Database connection pool. More...
#include <connpool.h>
Classes | |
| struct | serverNameCompare |
| compares server namees, but is smart about replica set names More... | |
Public Member Functions | |
| void | setName (const string &name) |
| right now just controls some asserts. More... | |
| void | onCreate (DBClientBase *conn) |
| void | onHandedOut (DBClientBase *conn) |
| void | onDestroy (DBClientBase *conn) |
| void | flush () |
| DBClientBase * | get (const string &host, double socketTimeout=0) |
| DBClientBase * | get (const ConnectionString &host, double socketTimeout=0) |
| void | release (const string &host, DBClientBase *c) |
| void | addHook (DBConnectionHook *hook) |
| void | appendInfo (BSONObjBuilder &b) |
| void | clear () |
| Clears all connections for all host. | |
| bool | isConnectionGood (const string &host, DBClientBase *conn) |
| Checks whether the connection for a given host is black listed or not. More... | |
| void | removeHost (const string &host) |
| virtual string | taskName () const |
| virtual void | taskDoWork () |
Additional Inherited Members | |
Static Public Attributes inherited from mongo::PeriodicTask | |
| static Runner * | theRunner = 0 |
Database connection pool.
Generally, use ScopedDbConnection and do not call these directly.
This class, so far, is suitable for use with unauthenticated connections. Support for authenticated connections requires some adjustments: please request...
Usage:
{ ScopedDbConnection c("myserver"); c.conn()... }
| bool mongo::DBConnectionPool::isConnectionGood | ( | const string & | host, |
| DBClientBase * | conn | ||
| ) |
Checks whether the connection for a given host is black listed or not.
| hostName | the name of the host the connection connects to. |
| conn | the connection to check. |
|
inline |
right now just controls some asserts.
defaults to "dbconnectionpool"
1.8.3.1