尝试找出主题的最大值是多少,以及默认值是多少
似乎在任何地方都找不到此信息
发布于 2020-12-16 03:17:16
尽管它是一个timespan,但最大超时是UInt32.MaxValue,这是使用TimeSpan.FromMilliseconds(UInt32.MaxValue)或49.7天多一点的时间设置的。看着https://referencesource.microsoft.com/#System.Messaging/System/Messaging/MessageQueue.cs
{
long timeoutInMilliseconds = (long)timeout.TotalMilliseconds;
if (timeoutInMilliseconds < 0 || timeoutInMilliseconds > UInt32.MaxValue)
throw new ArgumentException(Res.GetString(Res.InvalidParameter, "timeout", timeout.ToString()));```发布于 2016-02-25 19:59:00
MessageQueue.BeginReceive的默认值是“无超时”。
MessageQueue.BeginReceive( TimeSpan )的最大值将取决于您使用的TimeSpan。例如,使用'ticks‘TimeSpan表示最大为922,337,203,685.5秒(将近30,000年)。
https://stackoverflow.com/questions/35545935
复制相似问题