Making Connections
lgo_ConnectAccept()
Accept a connection request from a remote system.
#include "laygo.h"
LResult lgo_ConnectAccept
(
LCid cid,
LCtlBuffer buffer,
LBufferSize count
);
| cid | connection to accept connection on |
| buffer | protocol-specific data to include in accept |
| count | number of bytes in buffer |
lgo_ConnectAccept() accepts a connection request from a remote system. A successful return means that a communication session has been established, and data transmission can begin.
lgo_ConnectAccept() is a valid command only in lgo_STATE_WAITING_FOR_LOCAL_ACCEPT. A connection on which a listen request has been issued may receive an lgo_EVENT_CONNECT_REQUEST. lgo_ConnectAccept() is used in response to accept the request. lgo_ConnectAccept() is not used if an lgo_EVENT_CONNECTED is received instead. Whether data can be or needs to be provided depends on the protocol.
If successful, lgo_ConnectAccept() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:
if (lgo_ConnectAccept(cid, NULL, 0) < 0)
{
return (FAILURE);
}