danbarua / NEventSocket

A reactive FreeSwitch eventsocket library for Modern .Net
Mozilla Public License 2.0
74 stars 37 forks source link

Cancel networkStream.ReadAscync() on socket shutdown #68

Open danbarua opened 7 years ago

danbarua commented 7 years ago

Issue from LinkedIn:

Dan,
Is there any way I could cancel ReadAsync on NetworkStream object.
We get some threads blocked and can't close TcpClient underlying tcp connection. The reason i am asking as ReadAsync is overloaded method.
ReadAsync(Byte[], Int32, Int32, CancellationToken)
Any help will be greatly appreciated.
Best regards,
Rus