C4 Engine Terathon Software C4 Engine API Documentation

• Network Manager

API Links
Developer Links

NetworkMgr::GetConnectionCount

Defined in:  C4Network.h
Returns returns the number of connections which are currently established.
Prototype

long GetConnectionCount(void);

Description
The GetConnectionCount function returns the total number of connections which are currently established, including those which were initiated by the local machine and those which were initiated by remote machines. The number of connections initiated remotely which are accepted by the local machine can be limited by calling NetworkMgr::SetMaxConnectionCount.

It may be useful to poll the GetConnectionCount function after disconnecting from remote machines, but before terminating the Network Manager. When GetConnectionCount returns zero, all connections have been terminated in an orderly fashion, and it is safe to call NetworkMgr::Terminate.
See Also

NetworkMgr::Connect

NetworkMgr::Disconnect

NetworkMgr::GetMaxConnectionCount

NetworkMgr::SetMaxConnectionCount

NetworkMgr::Terminate