Questions tagged «msmq-wcf»

2
Python通过win32com运行MessageQueue.Peek,如何正确设置超时时间?
首先,我想说如果有人可以在这里提供帮助,您真是不可思议。 一般问题 我的Python程序需要与MSMQ进行交互。基本上,我想窥视一个队列,如果队列中没有任何内容,则指定一个超时。 但是,尽管我已尽力而为,但当队列中先前没有任何值时,我无法让Peek()等待超时间隔。 您能否指出此代码中缺少的内容? 我当前的代码 现在是我的代码: from socket import gethostname import win32com.client import pythoncom import clr clr.AddReference("System") clr.AddReference("System.Messaging") from System import TimeSpan from System.Messaging import MessageQueue # Source: [1] # [1] https://docs.microsoft.com/en-us/previous-versions/windows/desktop/msmq/ms707027%28v%3dvs.85%29 MQ_DENY_NONE = 0x0 MQ_PEEK_ACCESS = 0x1 MQ_SEND_ACCESS = 0x2 # Set up queue pythoncom.CoInitialize() qinfo = win32com.client.Dispatch("MSMQ.MSMQQueueInfo") …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.