MSGQ_locate
2-250
C Interface
Syntax
status = MSGQ_locate(queueName, msgqQueue, locateAttrs);
Parameters
String
queueName; /* Name of message queue to locate */
MSGQ_Queue *msgqQueue; /* Return located message queue here */
MSGQ_LocateAttrs
*locateAttrs;
/* Locate attributes */
Return Value
Int
status;
/* status */
Reentrant
yes
Description
The MSGQ_locate function is used to locate an opened message queue.
This function is synchronous (that is, it can block if timeout is non-zero).
This function is performed by a writer. The reader must have already
called MSGQ_open for this queueName.
MSGQ_locate firsts searches the local message queues for a name
match. If a match is found, that message queue is returned. If no match
is found, the transports are queried one at a time. If a transport locates
the queueName, that message queue is returned. If the transport does
not locate the message queue, the next transport is queried. If no
transport can locate the message queue, an error is returned.
In a multiple-processor environment, transports can block when they are
queried if you call MSGQ_locate. The timeout in the MSGQ_LocateAttrs
structure specifies the maximum time each transport can block. The
default is SYS_FOREVER (that is, each transport can block forever).
Remember that if you specify 1000 clock ticks as the timeout, the total
blocking time could be 1000 * number of transports.
Note that timeout is not a fixed amount of time to wait. It is the maximum
time each transport waits for a positive or negative response. For
example, suppose your timeout is 1000, but the response (found or not
found) comes back in 600 ticks. The transport returns the response then;
it does not wait for another 400 ticks to recheck for a change.
If you do not want to allow blocking, call MSGQ_locateAsync instead of
MSGQ_locate.
The locateAttrs parameter is of type MSGQ_LocateAttrs. This type has
the following structure:
MSGQ_locate
Synchronously find a message queue