msg_send
msg_send
Send a message to a message queue
bool **msg_send** SysvMessageQueue $queue int $message_type $message bool $serialize bool $blocking int $error_code
sends a of type
(which MUST be greater than 0) to
the message queue specified by .
msg_send``message``message_type``queue
queueThe message queue.
message_typeThe type of the message (MUST be greater than 0)
messageThe body of the message.
Opmerking: > If set to false is supplied, MUST be of type: , , or . In other case a warning will be issued.
serialize``string``int``float``bool
serialize
The optional controls how the
is sent.
defaults to true which means that the is
serialized using the same mechanism as the session module before being
sent to the queue. This allows complex arrays and objects to be sent to
other PHP scripts, or if you are using the WDDX serializer, to any WDDX
compatible client.
serialize``message``serialize``message
blocking
If the message is too large to fit in the queue, your script will wait
until another process reads messages from the queue and frees enough
space for your message to be sent.
This is called blocking; you can prevent blocking by setting the
optional parameter to false, in which
case will immediately return false if the
message is too big for the queue, and set the optional
to ,
indicating that you should try to send your message again a little
later on.
blocking``msg_send``error_code``MSG_EAGAIN
error_codeIf the function fails, the optional errorcode will be set to the value of the system errno variable.
return.success
Upon successful completion the message queue data structure is updated as
follows: is set to the process-ID of the
calling process, is incremented by 1 and
is set to the current time.
msg_lspid``msg_qnum``msg_stime
msg_remove_queue``msg_receive``msg_stat_queue``msg_set_queue