Go to the first, previous, next, last section, table of contents.
- C function: FM_stream * FM_begin_message (ULONG recipient, ULONG length, ULONG handler)
-
Open a message stream to a given recipient and acquire a lock on the
send queue. Arguments are:
- recipient
-
Recipient's ID
- length
-
Total message length in bytes
(see section Semantics)
- handler
-
Handler ID whose associated handler function the receiver will
invoke upon message reception.
Returns a pointer to the stream or NULL if FM can't guarantee that:
-
The specified number of bytes can be sent deadlock-free, and
-
The send queue is not locked by another thread.
FM_begin_message() must be called before
FM_send_piece() and FM_end_message().
- C function: void FM_send_piece (FM_stream *sendstream, void *buffer, ULONG length)
-
Send a number of bytes from a buffer to a stream. May be called several
times for the same message (i.e. between a
FM_begin_message()
... FM_end_message() pair and with the same FM_stream
* argument). Arguments:
- sendstream
-
Pointer to the message stream returned by
FM_begin_message().
- buffer
-
Pointer to a buffer containing the data to send.
- length
-
Number of bytes to be sent from the buffer.
- C function: void FM_end_message (FM_stream *sendstream)
-
End a message stream and finish sending the message. Also unlocks the
send queue, enabling other threads to lock it.
Go to the first, previous, next, last section, table of contents.