Inter-Process Communication : Message Queue ?
hi guys,
i want to figure out about
How to use IPC: message queue in Qt
Does there have any way to do this ?
i'm using Qt 4.7 , and find the page Inter-Process Communication in Qt
there not mention about message queue ,
does that mean current Qt 4.7 not support Message queue to communicate
between Qt process and non-Qt process ?
or there is another way to do ?
any help would be appreciated ,
thanks
Re: Inter-Process Communication : Message Queue ?
Quote:
there not mention about message queue ,
does that mean current Qt 4.7 not support Message queue to communicate
between Qt process and non-Qt process ?
That is a higher lever construct.
Qt offers you the building blocks to implement such a thing.
You can send and receive messages across processes in any of the ways in the link you posted.
And you have the QEventLoop.
If you wish to use a message loop construct, then you will have to implement it.
You can for example use QEventLoop to handle your messages.
One way would be to pack your incoming messages in to QEvent, and place them in to an event loop of a working thread.
Re: Inter-Process Communication : Message Queue ?
If you want to use message queues, use the native API (such as msgctl, msgget, msgrcv and msgsnd on Linux) as the concept is not portable across platforms anyway.
Re: Inter-Process Communication : Message Queue ?
finally i use the native API to solve this problem , and it work properly till now
the only thing is i can't compiler under windows now :(
thanks your reply ~
Re: Inter-Process Communication : Message Queue ?
Then implement the windows API equivalent to the code that runs for you on other systems.
Re: Inter-Process Communication : Message Queue ?
You might want to have a look at ZeroMQ and the existing Qt binding nzmqt. ZeroMQ is a portable and very efficient message queue. It can bee used for IPC or network communication and is LGPL'ed.