While using 4.24B, I had mysterious corrupted data and missing messages that
disappeared when I used 4.24A. Also, QNX clarified that 4.24A is the latest
version. (There was a small mistake with the versioning.)
MQ_NODE =1 will use Mqueue on node 1 and all mqueue’s will be created on
node 1. Also in this configuration you will not need to run Mqueue on any
other node. I wouldn’t poll the mqueue but you can see how many messages
are in it with mq_getattr().
I don’t use proxies so I don’t know how to advise about them - yet.
Do you need to handle the case where the client is on a different node than
the server? or will they always be on the same node? If they will always be
on the same node then set MQ_NODE=1 on node 1 and MQ_NODE=2 on node 2 and
see what happens (make sure Mqueue is running on each node).
Jon Mills wrote:
Barry, Ken,
After further investigation, it seems that when we set MQ_NODE to 1, the
data is going to the queue on node 1. Unfortunately, we use a proxy to
generate a signal to the server when the queue becomes non-empty. This
signal does not appear to be being trasmitted across the network. I
guess we need some kind of virtual circuit. Is it more common to poll
for the queue being non-empty than to use a signal?
Thanks for you help.
Jon.
P.S. Ken, you mention that we should use 4.25A rather that 4.24B, but we
now appear to be using MQ_NODE and 4.24B without problems. What is the
problem with 4.24B?
-----Original Message-----
From: Barry Millman [mailto:> bmillman@entrenet.com> ]
Posted At: 21 September 2000 14:24
Posted To: qnx
Conversation: Mqueue problem
Subject: Re: Mqueue problem
Jon:
I don’t have my docs with me, but you got trapped into the problem
of
software for the non-networked UNIX world being ported to QNX.
The solution to your problem is this…before you access a queue on
a
remote node you must set an ENVIRONMENT VARIABLE which I believe is
called
MQ_NODE (what a pain in the foot!). It would be nice (but currently is
illegal) if we could specify a node number when we do an mq_open().
Shameless advertisement: This is beautifully discussed (with
examples
and hands-on exercises) in our Real-Time QNX Programming Computer-Based
Training Course…take a look at:
http://www.igetitnow.com
Barry
QNX Training at Your Desktop…with Your Success Guaranteed!
http://www.igetitnow.com
Jon Mills wrote:
I am currently working on some code using POSIX style queues, and have
two processes, a client writing into the queue, and a server reading
from it. If I run these processes on the node I am logged into, this
works fine. If however I run one or both of the processes on another
node (e.g. “on -n4 RepServer”), the sender sends the data to the queue
(or seems to think it does), but the server does not see the data
arriving in the queue. I am using a proxy to signal the server when
the
queue goes from empty to non-empty.
It appears that the queue is always being created on Node 1, which is
the node I am logged into. If I use the command “ls -l /dev/mqueue”
from
Node 1, the queue can always be seen regardless of which node the
processes are running on. The command “ls -l //4/dev/mqueue” results
in
no queue being seen. I have tried using the setenv() function to set
the
environment variable MQ_OPEN to a value of 1 in both client and
server,
but this does not help. Is this the correct use of MQ_OPEN? Should I
set
it to a number (e.g. 4) or a node name?
Any ideas?
Best Regards, Jon Mills.
–