I’m trying to implement a timeout feature based on NetworkStream
old Async methods.
Due to the fact that calling EndRead
to a closed NetworkStream
will throw an "ObjectDisposedException", I wonder if I can simply avoid to call EndRead
instead of catching that exception as it is like an ugly hack.
Asked
Active
Viewed 38 times
0

DIF
- 2,470
- 6
- 35
- 49

AhSeng Fan
- 397
- 5
- 11
-
1I like the idea of an `ObjectDespisedException` [sic] :) did you try it, and what happened? any code to go with your question? – Cee McSharpface Apr 11 '18 at 09:29
-
@dlatikay Id be for ever throwing it – TheGeneral Apr 11 '18 at 09:30
-
Thanks for this lol – AhSeng Fan Apr 11 '18 at 09:30