大网数据广告活动
Web服务器与PHP

Time-out Occurs When an Application Calls the Poll Method

· 52CE 我爱测

This article provides workarounds for the time-out issue that occurs when an application calls the Poll method.

Applies to: .NET Core

Symptoms

A time-out occurs when you run an application that's using the System.Net.Security.SslStream class and that calls the System.Net.Socket.Poll method to check data on the underlying socket. When this issue occurs, the Poll method returns a value of false.

Cause

The SslStream class is reading data from the socket faster than the application can read data from the stream buffer.

Solution

To work around this issue, use one of the following methods:

  • Don't use the Poll method in the application. Instead, use the Asynchronous Programming Model (APM) pattern to get callbacks when data arrives.
  • If you must use the Poll method, when the method returns a value of true, make sure that all the stream buffer data was read before you enter another Poll call.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors (upstream author metadata: aartig13). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 07/08/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。