Transferring Data

Write

lgo_Write()

Write data on a connection.

Syntax
#include "laygo.h"

LResult lgo_Write
    (
        LCid           cid,
        LDataBuffer    buffer,
        LBufferSize    count
    );
cidconnection to write on
bufferbuffer containing data to write
countnumber of bytes in buffer
Description

lgo_Write() writes data to the connection for transmission to the remote system. A successful return by lgo_Write() means that the data has been accepted for transmission on the connection. It does not mean that the data has been successfully transmitted or received by the remote system. An end-to-end protocol should be used by the application to insure successful transmission to the remote system.

The minimum number of bytes which can be written by one call to lgo_Write() is 1. The maximum number of bytes which can be written by one call to lgo_Write() depends on the configuration of the underlying protocols and the system buffer pool.

Return Values

If successful, lgo_Write() returns a non-negative value representing the number of bytes written. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_WriteSpecial()

Example
if ((bytes = lgo_Write(cid, buffer, count)) < 0)
{
    /* process error */
}