amarquee.library/QSendRawOp amarquee.library/QSendRawOp
NAME
QSendRawOp - Send a socket packet to the remote host.
SYNOPSIS
#include
LONG QSendRawOp(struct QSession * session, void * buffer, ULONG bufferLength)
FUNCTION
This function allows you to send a buffer of data to the remote host
to which your session is connected earlier via a call to QNewSocketSession(),
QNewSocketSessionAsync() or QNewSocketServerSession(). The remote host will
receive exactly the data that are in the buffer.
When another client sends you data via QSendRawOp(), or via an equivalent function
in another socket library like send() in bsdsocket.library, your client will receive a
QMessage. That QMessage will have a qm_ID of zero, and the qm_Path field will contain
the host name of the sending host and the local port number (e.g. "ACS.hostile.cx:1037").
NOTE
Data passed with this function will be streamed, so you do not
have to worry about synchronization.
You may only use this function with QSessions which are created with a QNewSocket****Session()
function.
This function requires amarquee.library v49+.
INPUTS
session - The session to wish to send the message op to.
buffer - A pointer to the first byte of the data buffer you
wish to transmit. If NULL is specified, a one-byte
buffer containing the NUL byte will be transmitted.
bufferLength - The length of the data buffer, in bytes.
RESULTS
Returns the assigned ID number of the message operation on success,
or 0 on failure. Any later errors will be sent asynchronously
as QMessages.
EXAMPLE
LONG transID;
LONG data[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
/* Send a message containing the array data to the remote host. */
if (transID = QSendRawOp(session, data, sizeof(data)))
printf("Message op succeeded, was given id #%li\n",transID);
else
printf("Message op failed. (no memory?)\n");
AREXX NOTES
In ARexx, the third argument is optional. If it is not specified,
then the length of the third argument will be computed automatically
so that the entire ARexx string is sent. (that is, it defaults to
length(data)+1.)
AREXX EXAMPLE
transID = QSendRawOp(session, 'Hey Everybody!')
if (transID = 0) then say "Oops, operation failed"
SEE ALSO
QGo
Converted on 24 Mar 2002 with RexxDoesAmigaGuide2HTML 2.1e(private) by Michael Ranner.