T
Tester
Hello,
Could someone tell me under what conditions the following exception occurs
with async sockets:
"System.ArgumentException: The IAsyncResult object was not returned from the
corresponding synchronous method on this class."
This is being thrown from within the callback that is specified to
Socket.BeginReceive (happens rarely, but still does happen)
I see only 1 reference to this exception on the whole web, which is not
answered either.
The steps are very simple,
start()
{
Socket.BeginReceive(ReadCallback)
}
ReadCallback()
{
Socket.EndReceive
Socket.BeginReceive
}
One case that i noticed where this happens is when code is still executing
inside ReadCallback and socket gets disconnected then reconnected and
another Socket.BeginReceive is scheduled while previous ReadCallback didn't
return yet. There are some other cases where this exception occurs.
Thanks for any input on this
Could someone tell me under what conditions the following exception occurs
with async sockets:
"System.ArgumentException: The IAsyncResult object was not returned from the
corresponding synchronous method on this class."
This is being thrown from within the callback that is specified to
Socket.BeginReceive (happens rarely, but still does happen)
I see only 1 reference to this exception on the whole web, which is not
answered either.
The steps are very simple,
start()
{
Socket.BeginReceive(ReadCallback)
}
ReadCallback()
{
Socket.EndReceive
Socket.BeginReceive
}
One case that i noticed where this happens is when code is still executing
inside ReadCallback and socket gets disconnected then reconnected and
another Socket.BeginReceive is scheduled while previous ReadCallback didn't
return yet. There are some other cases where this exception occurs.
Thanks for any input on this