Open GoogleCodeExporter opened 8 years ago
Did you get any answer to this? I am also facing the same issue.
Why does this happen? .NET should take care of releasing the memory internally
if we
are closing the stream object. Isn't it?
Original comment by Nyoti.Ru...@gmail.com
on 22 Jul 2009 at 11:04
I am also having this problem.
Original comment by PlanetSa...@gmail.com
on 5 Aug 2009 at 8:14
I have found several issues with the code in the WroteData function in
AsynSocket.cs.
1) There is a section of code outside of the try/catch block. This code will
cause an unhanded exception. If/when an error occurs there.
2) The MemoryStream m_pending can be accessed in a "non-thread safe" way. This
can cause the m_pending.ToArray() call to throw an IO exception. This will also
trigger the above issue as well.
3) Uusing the test code provided in this thread, it is possible for the
underlying socket to close before all the threads have finished there callback
to WroteData(). Thus, causing a socket exception that is an inner exception for
an IO exception to be thrown when calling the m_stream.EndWrite() function.
This can be adjusted by looking for this wrapped exception and handling it
well. I think this third issue is what the original poster of this thread was
experiencing.
I have uploaded my changes to the WroteData() function here. Hope it helps.
Original comment by Hodge.Ga...@gmail.com
on 11 Apr 2013 at 4:07
Attachments:
Original issue reported on code.google.com by
victor.t...@gmail.com
on 23 Jun 2009 at 4:32Attachments: