Making Connections

Connect Accept

lgo_ConnectAccept()

Accept a connection request from a remote system.

Syntax
#include "laygo.h"

LResult lgo_ConnectAccept
    (
        LCid           cid,
        LCtlBuffer     buffer,
        LBufferSize    count
    );
cidconnection to accept connection on
bufferprotocol-specific data to include in accept
countnumber of bytes in buffer
Description

lgo_ConnectAccept() accepts a connection request from a remote system. A successful return means that a communication session has been established, and data transmission can begin.

lgo_ConnectAccept() is a valid command only in lgo_STATE_WAITING_FOR_LOCAL_ACCEPT. A connection on which a listen request has been issued may receive an lgo_EVENT_CONNECT_REQUEST. lgo_ConnectAccept() is used in response to accept the request. lgo_ConnectAccept() is not used if an lgo_EVENT_CONNECTED is received instead. Whether data can be or needs to be provided depends on the protocol.

Return Values

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

See Also

lgo_ConnectRequest()
lgo_ConnectReject()

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