C4 Engine Terathon Software C4 Engine API Documentation

• Network Manager

API Links
Developer Links

NetworkMgr::SetProtocol

Defined in:  C4Network.h
Sets the protocol identifier used by the current application.
Prototype

void SetProtocol(unsigned long protocol);

Parameters
protocol The 32-bit protocol identifier.
Description
The protocol identifier given by the protocol parameter is a unique 32-bit quantity that identifies the current application. The Network Manager will only allow connections from remote machines which are using the same protocol identifier as the local machine.

The high 16 bits of the protocol identifier represent the application, and the low 16 bits are used as a revision number. Every application must use its unique protocol identifier to prevent unintentional communications with other applications using the C4 Network Manager.

The SetProtocol function should be called before the Network Manager is initialized either by a direct call to NetworkMgr::Initialize or indirectly through the Message Manager function MessageMgr::BeginMultiplayerGame.
See Also
NetworkMgr::GetProtocol

NetworkMgr::Initialize

MessageMgr::BeginMultiplayerGame