int error = ReceiveData(APTR handle, APTR buf, int size, int *n, struct hwTagList *tags);
sizebytes from the connection specified by
handleto the memory buffer specified by
buf. Upon returning, your implementation of
ReceiveData()has to write the number of bytes copied to
n. Note that returning less than
nisn't considered an error by Hollywood. Even a value of 0 in
nisn't considered an error by Hollywood. It just indicates that there is currently no data to receive in the connection.
To indicate an error, your implementation of
ReceiveData() has to return an error
code. This can be a custom error registered through hw_RegisterError()
or one of Hollywood's predefined error codes (see
hollywood/errors.h). The following
predefined error codes have a special meaning:
Starting with Hollywood 9.0,
ReceiveData() may return -1 to indicate that all data has
been transferred. This must only be done by plugins which have taken over protocol handling
completely by setting
True in OpenConnection().
See OpenConnection for details. For such plugins, Hollywood will keep calling
ReceiveData() until it returns -1 to signal that all data has been transferred.