Making Connections

Listen

lgo_Listen()

Listen for a connection request from a remote system.

Syntax
#include "laygo.h"

LResult lgo_Listen
    (
        LCid    cid
    );
cidconnection to place in listening state
Description

lgo_Listen() initiates a wait for connection requests from remote systems. An unsuccessful return from lgo_Listen() means that no requests will be received from a remote system.

If a call to lgo_Listen() succeeds, the application may either cancel the listen request by calling lgo_ListenCancel() or poll for the receipt of a request from a remote system by calling lgo_Poll() or lgo_Event().

Return Values

If successful, lgo_Listen() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_ListenCancel()

Example
if (lgo_Listen(cid) < 0)
{
     return (FAILURE);
}