lgo_RpcConnectServer()
Establish a connection to the LayGO RPC Server based on server index.
#include "laygo.h" LServerId lgo_RpcConnectServer ( LServerIndex server );
server | index of server to connect to |
lgo_RpcConnectServer() establishes a connection to a LayGO RPC Server. RPC name service is used to locate the server based on server index.
lgo_RpcConnectServer() must be the first API function called when using the RPC version of LayGO. If lgo_RpcConnectServer() fails, it is not safe to call any other API function. Failure to observe this restriction may result in an application exception.
Clients can connect to only one server at a time.
If successful, lgo_RpcConnectServer() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:
lgo_ConnectServer()
lgo_ConnectServerIp()
lgo_ConnectServerLocal()
lgo_DisconnectServer()
lgo_ShutdownServer()
lgo_RpcConnectServerIp()
lgo_RpcConnectServerLocal()
lgo_RpcDisconnectServer()
lgo_RpcShutdownServer()
if (lgo_RpcConnectServer(0) < 0) { exit(EXIT_FAILURE); }