Name
SendData -- send bytes to connection (V8.0)
Synopsis
int error = SendData(APTR handle, APTR buf, int size, int *n, struct
                         hwTagList *tags);
Function
Hollywood will call this function to ask your network adapter to send size bytes from the memory buffer buf to the connection specified by handle. Upon returning, your implementation of SendData() has to write the number of bytes successfully sent to n. Note that returning less than size bytes in n isn't considered an error by Hollywood. Even a value of 0 in n isn't considered an error by Hollywood. It just indicates that currently no bytes could be sent to the connection.

To indicate an error, your implementation of SendData() 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:

ERR_SENDTIMEOUT:
Return this error code if a timeout has been hit.

Inputs
handle
connection handle returned by OpenConnection()
buf
memory buffer containing data to send
size
number of bytes to send from memory buffer source
n
number of bytes actually sent
tags
reserved for future use (currently NULL)
Results
error
error code or 0 for success

Show TOC