我正在使用 System.Messaging.MessageQueue 在 LAN 上发送和接收多播 System.Messaging.Messag - 这工作正常。
但是,我需要在不使用消息队列的情况下接收消息。
由于 MessageQueue 使用 PGM 协议(113)发送消息,我正在尝试构建一种使用套接字侦听 PGM(协议 113)的类型(例如 new Socket(AddressFamily.InterNetwork, SocketType.Rdm,(协议类型)113);)。 该类型正在接收消息数据,但它是文本格式(带有soap格式化程序部分 - 请参阅msdn上的示例 http://msdn.microsoft.com/en-us/library/cc219170.aspx)
我显然想要二进制数据,这样我就可以将其转换为 System.Messaging .消息并获取真实数据。
非常感谢任何有关我如何做到这一点的想法。
I am using the System.Messaging.MessageQueue to send and receive multicast System.Messaging.Message’s on my LAN – this works fine.
However, I have a requirement to receive the msgs without using a message queue.
As the MessageQueue uses the PGM protocol (113) to send messages I am trying to build a type that listens on PGM (protocol 113) using a socket (e.g. new Socket(AddressFamily.InterNetwork, SocketType.Rdm, (ProtocolType)113);). The type is receiving message data but it is in a text format (with a soap formatter section -see example this example on msdn http://msdn.microsoft.com/en-us/library/cc219170.aspx)
I obviously want binary data so i can cast it into a System.Messaging.Message and get at the real data.
Any ideas on how i can do this are greatly appreciated .
发布评论
评论(2)
如果您纯粹想在 MS Windows 上使用 PGM,那么 Emcaster 是非常好的信息源示例如何使用它。
但是,如果您正在寻找具有更广泛功能的更成熟的解决方案,那么 nServiceBus 框架应该是您的选择选择。
If you are looking purely for PGM use on MS Windows then Emcaster is very good info source with example how to use it.
But if you are looking for more mature solution with broader range of capability then nServiceBus framework should be your choice.
你可以偷看一下吗? MSMQ 支持该功能。 或者您只是想读取您通常不监听的队列上的消息?
You can just peek at them? The MSMQ supports that functionality. Or are you just trying to read messages on queues you don't typically listen on?