Writing a message to a message queueΒΆ

write_msg_queue()

Writing a message to a message queue


SYNTAX

write_msg_queue(msg_id, msg_text, mtype, options)

Writes a message to the message queue specified in msg_id.

msg_id

The return value from the function that created or linked to the message queue.

msg_text

The message text. If this argument is a binary constant or binary field, the message is sent in binary, otherwise as normal text.

mtype

The message type. Types are user defined and can be any integer value. The message type has no meaning to Sculptor or to the operating system; the feature is provided for programmers to use in any way they wish.

options

May be GENOPT_WAIT or 0.

If options is GENOPT_WAIT and the message queue is full, the function waits until the message can be sent.

If options is 0, the function returns immediately if the message queue is full.

The function returns the length of the message, or a negative value indicating an error:

-1

Unexpected error (see sys.Errno)

-2

The message queue has been removed.

-3

The message queue is full.


Message queue functions

create_msgqueue()

Create a message queue

link_msg_queue()

Link to an existing message queue

read_msg_queue()

Read a message from a message queue

write_msg_queue()

Write a message to a message queue

remove_msg_queue()

Remove a message queue