Requesting Information

Maximum Buffer Size

lgo_MaxBufferSize()

Determine the maximum data buffer size which can be written on a connection.

Syntax
#include "laygo.h"

LResult lgo_MaxBufferSize
    (
        LCid    cid
    );
cidconnection to get maximum buffer size from
Description

lgo_MaxBufferSize() retrieves maximum number of bytes which can be written on a connection. If the CID is invalid, the size of the largest buffer in the system buffer pool is returned. The defined constant lgo_INVALID_CID can be used for this purpose.

The value returned by lgo_MaxBufferSize() may change if the underlying protocol is used to negotiate a change. For example, if the default packet size for an X.25 SVC is 128 bytes, this will be the return value of lgo_MaxBufferSize() after the SVC is opened. However, if the optional facilities are used to negotiate a packet size of 256 during call setup, lgo_MaxBufferSize() will return 256.

Return Values

lgo_MaxBufferSize() returns a non-negative value indicating the maximum number of bytes which can be written on a connection.

See Also

lgo_Write()

Example
if (packetSize > lgo_MaxBufferSize(lgo_INVALID_CID))
{
    return (FAILURE);
}