首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MessageQueue.BeginReceive TimeSpan超时

MessageQueue.BeginReceive TimeSpan超时
EN

Stack Overflow用户
提问于 2016-02-22 12:41:09
回答 2查看 147关注 0票数 0

尝试找出主题的最大值是多少,以及默认值是多少

似乎在任何地方都找不到此信息

EN

回答 2

Stack Overflow用户

发布于 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

代码语言:javascript
复制
        {
            long timeoutInMilliseconds = (long)timeout.TotalMilliseconds;
            if (timeoutInMilliseconds < 0 || timeoutInMilliseconds > UInt32.MaxValue)
                throw new ArgumentException(Res.GetString(Res.InvalidParameter, "timeout", timeout.ToString()));```
票数 1
EN

Stack Overflow用户

发布于 2016-02-25 19:59:00

MessageQueue.BeginReceive的默认值是“无超时”。

MessageQueue.BeginReceive( TimeSpan )的最大值将取决于您使用的TimeSpan。例如,使用'ticks‘TimeSpan表示最大为922,337,203,685.5秒(将近30,000年)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35545935

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档