Managing Protocol Services

Open Protocol

lgo_OpenProtocol()

Reserve system resources for a communication service.

Syntax
#include "laygo.h"

LCid    lgo_OpenProtocol
    (
        LProtocol    protocol,
        LMajorId     major,
        LMinorId     minor
    );
protocolid of protocol to open
majorid of major device
minorid of minor device
Description

lgo_OpenProtocol() reserves the system resources required for a communication session using the given protocol. Its functionality is identical to that of lgo_Open() except that it does not use the service database.

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

Return Values

If successful, lgo_OpenProtocol() returns a non-negative connection identifier (CID) which uniquely identifies the connection during subsequent transactions. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_Open()
lgo_Attach()
lgo_AttachProtocol()

Example
LCid    cid;

if ((cid = lgo_OpenProtocol(lgo_PROTOCOL_X21_BIS, 0, 0) < 0)
{
    return (FAILURE);
}