Making Connections

Disconnect Request

lgo_DisconnectRequest()

Initiate termination of a communication session established with a remote system.

Syntax
#include "laygo.h"

LResult lgo_DisconnectRequest
    (
        LCid           cid,
        LCtlBuffer     buffer,
        LBufferSize    count
    );
cidconnection to disconnect
bufferprotocol-specific data to include in request
countnumber of bytes in buffer
Description

lgo_DisconnectRequest() initiates an orderly termination of a communication session. The application should poll for completion of the termination using lgo_Poll() or lgo_Event().

An unsuccessful return from lgo_DisconnectRequest() means that no disconnect request was initiated.

Return Values

If successful, lgo_DisconnectRequest() 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_DisconnectConfirm()

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