Determine the state of a connection.
#include "laygo.h" LState lgo_State ( LCid cid );
|cid||connection to determine the state of|
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.
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.
printf("The current state of CID %d is %s\n", (int) cid, lgo_StateMessage(lgo_State(cid));