Requesting Information

Get Statistics

lgo_GetStatistics()

Retrieve the statistics table for a connection.

Syntax
#include "laygo.h"

LResult lgo_GetStatistics
    (
        LCid           cid,
        LCtlBuffer     buffer,
        LBufferSize    size
    );
cidconnection to get statistics from
bufferbuffer to hold the returned statistics
sizesize of buffer in bytes
Description

lgo_GetStatistics() retrieves the statistics table for a connection, if one exists. If the call to lgo_GetStatistics() is successful, the contents of the control buffer passed to the function may be cast to type LStatisticsTable as defined in laygodef.h.

Return Values

If successful, lgo_GetStatistics() returns a non-negative value indicating the number of bytes returned into the buffer. A return value of 0 means that there is no statistics table for the connection. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_ClearStatistics()
lgo_GetStatus()

Example
size = lgo_GetStatistics(cid, buffer, bufCapacity);

if (size > 0)
{
    statStrings = lgo_StatisticMessages(lgo_Protocol(cid));
    /* display statistics here */
    lgo_ClearStatistics(cid);
}