Time-out occurs when an application calls the Poll method
Original product version: .NET Core
Symptom
A time-out occurs when you run an application that is 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 happens, the Poll
method returns false.
Cause
The SslStream
class is reading data from the socket faster than the application can read data from the stream buffer.
Workaround
To work around this issue, use one of the following methods:
- Don't use the
Poll
method in the application. Use the Asynchronous Programming Model (APM) pattern to get callbacks when data arrives instead. - If you must use the
Poll
method, when the method returns true, make sure that all the stream buffer data has been read before you enter anotherPoll
call.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for