RPC Server Support

RPC Open Protocol

lgo_RpcOpenProtocol()

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

Syntax
#include "laygo.h"

LCid    lgo_RpcOpenProtocol
    (
        LServerId    serverId,
        LProtocol    protocol,
        LMajorId     major,
        LMinorId     minor
    );
serverIdserver to open on
protocolid of protocol to open
majorid of major device
minorid of minor device
Description

lgo_RpcOpenProtocol() reserves the system resources required for a communication session using the given protocol, on a particular server. Its functionality is identical to that of lgo_RpcOpen() except that it does not use the service database.

If a CID returned by lgo_RpcOpenProtocol() is detached, a new one can be obtained by calling lgo_RpcAttachProtocol() with the same parameters given to lgo_RpcOpenProtocol().

Return Values

If successful, lgo_RpcOpenProtocol() 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_RpcOpen()

Example
LServerId    serverId
LCid         cid;

if ((serverId = lgo_RpcConnectServer(0)) >= 0)
{
    if ((cid = lgo_RpcOpenProtocol(serverId, lgo_PROTOCOL_X21_BIS, 0, 0) < 0)
    {
         lgo_RpcDisconnectServer(serverId);

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

        lgo_Detach(cid);

        lgo_RpcDisconnectServer(serverId);

        return (SUCCESS);
    }
}