Requesting Information

State

lgo_State()

Determine the state of a connection.

Syntax
#include "laygo.h"

LState  lgo_State
    (
        LCid    cid
    );
cidconnection to determine the state of
Description

lgo_State() returns the state of the connection.

Note: State changes based on receipt of control events from a remote system do not affect the state of the API until delivered to the application by a successful call to lgo_Event(). The application must use lgo_Poll(), rather than lgo_State(), to test for the receipt of control events.

Return Values

All calls to lgo_State() return a non-negative state identifier indicating the state of the API on the connection. Possible return values are:

CIDs which have not been opened return lgo_STATE_CLOSED, even if the value of the CID parameter is not a possible CID.

See Also

lgo_Event()
lgo_Poll()
lgo_StateMessage()

Example
printf("The current state of CID %d is %s\n", (int) cid, lgo_StateMessage(lgo_State(cid));