2 #include "util/mutex.h" 4 #include <boost/noncopyable.hpp> 5 #include "NPLConnection.h" 20 void start(NPLConnection_ptr c);
25 void add(NPLConnection_ptr c);
31 void stop(NPLConnection_ptr c,
int nReason = 0);
42 virtual int DoCallBack(
const NPLConnection_ptr& c) {
return 0;};
57 typedef std::set<NPLConnection_ptr, NPLConnection_PtrOps> NPLConnectionPool_Type;
60 NPLConnectionPool_Type m_connections;
used for various callback.
Definition: NPLConnectionManager.h:40
define this to enable debugging of NPL code in visual studio
Definition: INPL.h:9
void stop(NPLConnection_ptr c, int nReason=0)
Stop the specified connection.
Definition: NPLConnectionManager.cpp:34
int CheckIdleTimeout()
for all active connections, check if any of them should be timed out.
Definition: NPLConnectionManager.cpp:70
void stop_all()
Stop all connections.
Definition: NPLConnectionManager.cpp:43
int get_connection_count()
get the total number of connected connections.
Definition: NPLConnectionManager.cpp:128
cross platform mutex
Definition: mutex.h:95
All incoming and outgoing connection sessions.
Definition: NPLConnectionManager.h:13
int ForEachConnection(NPLConnectionCallBack *pCallback)
it will iterate over all functions, and call NPLConnectionCallBack->DoCallBack(). ...
Definition: NPLConnectionManager.cpp:107
void start(NPLConnection_ptr c)
Add the specified connection to the manager and start it.
Definition: NPLConnectionManager.cpp:25