Making Connections

Connect Reject

lgo_ConnectReject()

Reject a connection request from a remote system.

Syntax
#include "laygo.h"

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

lgo_ConnectReject() rejects a connection request from a remote system and returns the connection to the open state.

A connection on which a listen request has been issued may receive an lgo_EVENT_CONNECT_REQUEST. lgo_ConnectReject() is used in response to reject the request. lgo_ConnectReject() is not a valid response if an lgo_EVENT_CONNECTED is received instead.

lgo_ConnectReject() is a valid command only in lgo_STATE_WAITING_FOR_LOCAL_ACCEPT.

Return Values

If successful, lgo_ConnectReject() 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_ConnectAccept()

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