D
David
I don't actually have a need to do this right now but was wondering... I
also assume the answer to this is going to be no but....
thread 1 calls an async socket.beginReceive() method which returns an
IAsyncResult. So at that moment thread 1 has this IAsyncResult. If the
callback method for that beginReceive calls beginReceive again, will thread
1's IAsyncResult reference from that first beginxxx call now reference the
second call, and so on? I assume no, it would produce a new IAsyncResult
object for each new beginxxx call.
To put it another way, I'm thinking from the perspective of that thread 1,
lets say it posts a beginReceive operation and it is concerned only with
when *all* the expected data is received, regardless of how many times the
receive callback iterates by repeating calls to beginReceive. The
IAsyncResult interface has the IsCompleted property and an AsyncWaitHandle.
So if that original IAsyncResult reference from thread 1 'followed' the
'whole operation from thread 1's perspective', it could be used to check on
completion status or wait from thread 1. Again, I assume this is not the
case and probably sounds real silly to those that know what their doing. I
assume the fact is that the IAsyncResult references only the one beginxxx
call it was created from, right?
I realize there are many other ways to accomplish what this example shows...
not looking to solve that, just wondering specifically about the
IAsyncResult with beginxxx() async calls.
any input is appreciated, laughing is perfectly acceptable as well,
considering I can't hear you
also assume the answer to this is going to be no but....
thread 1 calls an async socket.beginReceive() method which returns an
IAsyncResult. So at that moment thread 1 has this IAsyncResult. If the
callback method for that beginReceive calls beginReceive again, will thread
1's IAsyncResult reference from that first beginxxx call now reference the
second call, and so on? I assume no, it would produce a new IAsyncResult
object for each new beginxxx call.
To put it another way, I'm thinking from the perspective of that thread 1,
lets say it posts a beginReceive operation and it is concerned only with
when *all* the expected data is received, regardless of how many times the
receive callback iterates by repeating calls to beginReceive. The
IAsyncResult interface has the IsCompleted property and an AsyncWaitHandle.
So if that original IAsyncResult reference from thread 1 'followed' the
'whole operation from thread 1's perspective', it could be used to check on
completion status or wait from thread 1. Again, I assume this is not the
case and probably sounds real silly to those that know what their doing. I
assume the fact is that the IAsyncResult references only the one beginxxx
call it was created from, right?
I realize there are many other ways to accomplish what this example shows...
not looking to solve that, just wondering specifically about the
IAsyncResult with beginxxx() async calls.
any input is appreciated, laughing is perfectly acceptable as well,
considering I can't hear you