RPC Server Support
lgo_RpcOpen()
Reserve system resources for a communication service on a particular server.
#include "laygo.h"
LCid lgo_RpcOpen
(
LServerId serverId,
LService service
);
| serverId, | server to open on |
| service | name of entry in the service database to open |
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.
If successful, lgo_RpcOpen() returns the connection id. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:
lgo_Attach()
lgo_AttachProtocol()
lgo_Close()
lgo_Open()
lgo_ReOpen()
lgo_RpcAttach()
lgo_RpcAttachProtocol()
lgo_RpcOpenProtocol()
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);
}
}