W
William Stacey [C# MVP]
The doco for socket.BeginReceive says:
"All I/O initiated by a given thread is canceled when that thread exits. A
pending asynchronous operation can fail if the thread exits before the
operation completes."
I have been bitten by this recently. But it raises another question. If
you post another async read in a callback (as many do) from a prior read,
that 2nd BeginReceive is called on the IOCP thread, which can go away and
above should apply. So how does this ever work? Or is something fixed up
behind the covers. tia
"All I/O initiated by a given thread is canceled when that thread exits. A
pending asynchronous operation can fail if the thread exits before the
operation completes."
I have been bitten by this recently. But it raises another question. If
you post another async read in a callback (as many do) from a prior read,
that 2nd BeginReceive is called on the IOCP thread, which can go away and
above should apply. So how does this ever work? Or is something fixed up
behind the covers. tia