RPC Server Support

Connect Server

lgo_ConnectServer()

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

Syntax
#include "laygo.h"

LResult lgo_ConnectServer
    (
        LServerId    server
    );
serveridentifier of server to connect to
Description

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.

Return Values

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:

See Also

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

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