Making Connections

Connect Request

lgo_ConnectRequest()

Initiate a request to establish a communication session with a remote system.

Syntax
#include "laygo.h"

LResult lgo_ConnectRequest
    (
        LCid           cid,
        LCtlBuffer     buffer,
        LBufferSize    count
    );
cidconnection to attempt to effect
bufferprotocol-defined data to include in request
countnumber of bytes in buffer
Description

lgo_ConnectRequest() initiates a request to establish a communication session with a remote system. The application may either cancel the request by calling lgo_Reopen() or poll for the receipt of a response using lgo_Poll() or lgo_Event().

An unsuccessful return from lgo_ConnectRequest() means that no connection request was initiated.

The contents of the buffer, if any, are defined by the protocol.

Return Values

If successful, lgo_ConnectRequest() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_ConnectAccept()
lgo_ConnectReject()

Example
if (lgo_ConnectRequest(cid, NULL, 0) < 0)
{
     return (FAILURE);
}