RPC Server Support

RPC Connect Server

lgo_RpcConnectServer()

Establish a connection to the LayGO RPC Server based on server index.

Syntax
#include "laygo.h"

LServerId lgo_RpcConnectServer
    (
          LServerIndex    server
    );
serverindex of server to connect to
Description

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.

Return Values

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:

See Also

lgo_ConnectServer()
lgo_ConnectServerIp()
lgo_ConnectServerLocal()
lgo_DisconnectServer()
lgo_ShutdownServer()
lgo_RpcConnectServerIp()
lgo_RpcConnectServerLocal()
lgo_RpcDisconnectServer()
lgo_RpcShutdownServer()

Example
if (lgo_RpcConnectServer(0) < 0)
{
    exit(EXIT_FAILURE);
}