lgo_ConnectServer()
Establish a connection to the LayGO RPC Server based on server identifier.
#include "laygo.h" LResult lgo_ConnectServer ( LServerId server );
server | identifier of server to connect to |
lgo_ConnectServer() establishes a connection to a LayGO RPC Server. RPC name service is used to locate the server based on server identifier.
lgo_ConnectServer() must be the first API function called when using the RPC version of LayGO. If lgo_ConnectServer() 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_ConnectServer() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:
lgo_ConnectServerIp()
lgo_ConnectServerLocal()
lgo_DisconnectServer()
lgo_ShutdownServer()
lgo_RpcConnectServer()
lgo_RpcConnectServerIp()
lgo_RpcConnectServerLocal()
lgo_RpcDisconnectServer()
lgo_RpcShutdownServer()
if (lgo_ConnectServer(0) < 0) { exit(EXIT_FAILURE); }