|
Network Manager
C4Network.h
NetworkMgr::ConnectAttempts to establish a connection with another machine.
Prototype
Parameters
Description
The Connect function initiates an attempt to connect to the remote server whose address is given by the address parameter. This function returns immediately and the Network Manager begins listening for a response.If the connection is accepted by the server, then the Network Manager on both the client machine and the server machine 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 will call the Application::HandleConnectionEvent function when a connection is accepted.If the connection is denied by the server, or if the connection attempt times out, then the network event procedure is called with the kNetworkEventFail event on the client machine. The value of the param parameter passed to the network event procedure is one of the following values indicating why the connection could not be made.
Application::HandleConnectionEvent function with the kConnectionAttemptFailed event and passes the same failure code the application.The number of attempts to make a connection and the time interval between attempts are 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::Disconnect
NetworkMgr::SetNetworkEventProc
MessageMgr::Connect
Application::HandleConnectionEvent
|