lgo_RpcOpenProtocol()
Reserve system resources for a communication service on a particular server.
#include "laygo.h" LCid lgo_RpcOpenProtocol ( LServerId serverId, LProtocol protocol, LMajorId major, LMinorId minor );
serverId | server to open on |
protocol | id of protocol to open |
major | id of major device |
minor | id of minor device |
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().
If successful, lgo_RpcOpenProtocol() 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_RpcOpen()
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); } }