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