C4 Engine
C4 Engine API Documentation

NetworkMgr::GetConnectionCount

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

int32 GetConnectionCount(void);

Description
The GetConnectionCount function returns the total number of connections that are currently established, including those that were initiated by the local machine and those that were initiated by remote machines. The number of connections initiated remotely that 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