|
Network Manager
C4Network.h
NetworkMgr::DisconnectTerminates a connection with another machine.
Prototype
Parameters
Description
The Disconnect function terminates the connection with the machine whose address is given by the address parameter. If no connection to this address exists, then the Disconnect function has no effect.When a server receives a disconnect message from a client, the Network Manager on the server calls the currently installed network event procedure, if any. The low-level network event procedure can be set using the NetworkMgr::SetNetworkEventProc function, but this procedure should not be changed if the Message Manager is being used. Instead, the Message Manager on the server and on each remaining client in the game calls the Application::HandlePlayerEvent function to inform the application modules on those machines that a player has departed.The Network Manager attempts to disconnect in an orderly fashion by listening for an acknowledgement to the disconnection message. The number of attempts to disconnect and the time interval between these attempts are the same as those used for reliable packet transmission. These values can be changed using the NetworkMgr::SetReliableResendCount and NetworkMgr::SetReliableResendTime functions.
See Also
NetworkAddress
MessageMgr
NetworkMgr::Connect
NetworkMgr::SetNetworkEventProc
MessageMgr::Disconnect
Application::HandlePlayerEvent
|