LInet::OnDataReady

#include "ltwrappr.h"

virtual L_INT LInet::OnDataReady(plConnection, nError, pBuffer, ulSize)

LInet * plConnection;

/* instance of a remote computer */

L_INT nError;

/* error code */

L_CHAR *pBuffer;

/* buffer containing data */

L_SIZE_T ulSize;

/* size of the buffer */

Overridable function that notifies a computer that the data that has been received is ready to be read.

Parameter

Description

plConnection

Pointer to the instance of the remote computer from which to read the data.

nError

If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred. If nError is < SUCCESS, pBuffer should be ignored.

pBuffer

Pointer to a data buffer.

ulSize

The size of the data pointed to by pBuffer.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Immediately after successfully connecting to a LEADTOOLS server started with LInet::ServerInit, if auto process is not enabled, this function will be the first function called and pBuffer will contain a NULL terminated string containing "LEAD Technologies Server X.X" where X.X is the server version number. The user should read the data using LInet::ReadData.

This function is called before the LInet::OnImageReceived, LInet::OnMMediaReceived or LInet::OnUserXReceived functions are called, so that you can determine the total amount of data that will be received.

If auto process was not enabled for plConnection, pBuffer will be NULL, and you should read the data by calling LInet::ReadData.

The buffer pointed to by pBuffer will be freed upon returning from the function.

Do not delete plConnection or pBuffer.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ReadData, Class Members

Topics:

Sending and Receiving Data

Example

For an example, refer to LInet::ReadData.