lgo_RpcConnectServerLocal()
Establish a connection to the LayGO RPC Server on the local host.
#include "laygo.h" LServerId lgo_RpcConnectServerLocal ( void );
lgo_RpcConnectServerLocal() may be used in place of lgo_RpcConnectServer() to establish a connection to a LayGO RPC Server. lgo_RpcConnectServerLocal() tries to locate the server running on the local host. This is primarily useful in environments where RPC name service is not available.
lgo_RpcConnectServerLocal() must be the first API function called when using the RPC version of LayGO. If lgo_RpcConnectServerLocal() 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_RpcConnectServerLocal() 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_RpcConnectServer()
lgo_RpcConnectServerIp()
lgo_RpcDisconnectServer()
lgo_RpcShutdownServer()
if (lgo_RpcConnectServerLocal() < 0) { printf("Cannot connect to local server.\n"); exit(EXIT_FAILURE); }