Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : ClientSocket1.SendStream not releasing memorystream

www.cryer.info
Managed Newsgroup Archive

ClientSocket1.SendStream not releasing memorystream

Subject:ClientSocket1.SendStream not releasing memorystream
Posted by:"Angela" (angela.bodn..@noris.org)
Date:7 Mar 2006 10:59:12

Hello,
I have a working Delphi 6 application which sends data over a
non-blocking asynchronous ClientSocket using SendText.
I am trying to modify it in order to send binary data by using
a MemorySteam and ClientSocket1.SendStream.
I am able to successfully send the data using SendStream.
I receive an acknowledgement of receipt and the proper response
from the host.  So all this is working.  However, when I try to
process the the next message to be sent by memorystream.clear
or setsize, or anything with the memorystream, I get an
Access Violation.  I am assuming that the stream is not
being released from the SendStream.  According the the
documentation it should be freed automatically when the Windows
socket is done with it, and if I do try to free it I also get
an access violation.
So, does anyone know if there is something else I need to do to
get access to my memory stream again?  I do not want to drop the
connection after the send as this is a live application which
constantly sends data back and forth.
Let me know if you need any additional information.
Thanks for your help.
Angela

Replies:

www.cryer.info
Managed Newsgroup Archive