RPC Server Support

Rpc Open

lgo_RpcOpen()

Reserve system resources for a communication service on a particular server.

Syntax
#include "laygo.h"

LCid    lgo_RpcOpen
    (
        LServerId    serverId,
        LService     service
    );
serverId,server to open on
servicename of entry in the service database to open
Description

lgo_RpcOpen() reserves the system resources required for a communication session using the given service, on a particular server. It does not establish end-to-end communication with a remote system. After opening the connection, the application must call either lgo_ConnectRequest() to initiate a communication session or lgo_Listen() to wait for a remote system to initiate one. All other API functions which apply to a specific connection require a connection identifier returned by lgo_RpcOpen() as the first parameter.

Return Values

If successful, lgo_RpcOpen() returns the connection id. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_Attach()
lgo_AttachProtocol()
lgo_Close()
lgo_Open()
lgo_ReOpen()
lgo_RpcAttach()
lgo_RpcAttachProtocol()
lgo_RpcOpenProtocol()

Example
LServerId    serverId
LCid         cid;

if ((serverId = lgo_RpcConnectServer(0)) >= 0)
{
    if ((cid = lgo_RpcOpen(serverId, "PHYS0") < 0)
    {
         lgo_RpcDisconnectServer(serverId);

         return(FAILURE);
    }
    else
    {
        CheckStatus(cid);

        lgo_Detach(cid);

        lgo_RpcDisconnectServer(serverId);

        return (SUCCESS);
    }

}