0

设置:4 个进程需要监控一个集中的源(我在想消息队列),并在将消息放入队列时收到警报。这是为了报告每个进程需要知道的错误,以决定他们各自将如何处理它。

但是,我有几个问题,因为我想确保消息队列是解决此问题的最佳方式,然后再冒险走这条路。

Windows CE 上的消息队列 API 是否有某种事件/通知?如果没有,Windows CE 操作系统本身是否允许您以某种方式连接到队列以获取新消息到达的警报?对于这种设置和要求,是否有更好的进程间通信工具?

编辑:另外,这将是一个不会丢失的错误运行日志,所以我会将它放在我的闪存中。

4

1 回答 1

0

What always works is a simple TCP connection via loopback. This also makes it easy to debug on a desktop system, in case you want. Concerning CE's message queues, those are always 1:1, so you'd need as many as you have connections between processes. Also, if you want to use them in a TCP stream-like manner, you'll need one for each direction.

There is another way you could use, and that is to monitor the file that you're logging the info to. I'm not sure to what extent CE supports a notification API for file changes, but if you don't need low-latency reactions, you can always poll every now-and-then. Alternatively, use a named event after writing to the logfile.

于 2013-08-12T19:27:55.430 回答