> > Still having problems with this socket app. I am now using ICS for the > socket components after giving up on Indy. > > I am writing a TMemorystream to the socket at the client end, and reading > into a TMemorystream at the server end. > > procedure TClientThread.ServerWSocketDataAvailable(Sender: TObject; Error: > Word); > var > Command: Byte ; > ms: TMemoryStream ; > begin > ms := TMemoryStream.Create ; > try > Size := ClientWSocket.Receive(@ms, SizeOf(Packet)+1) ; > if Size > 0 then > begin > ms.Seek(1, soFromBeginning) ; > ms.Read(Command, SizeOf(command)) ; > SizeOf(Packet) is the max size I expect in. Size shows the correct size for > the structure I have sent. > The ms.Seek line fails with "Access violation at 0x77f60b77: write of > address 0x00ae0ffc" > > Any ideas? >
>From the receive method on the client socket inside the server Data Available event, >it is hard to guess your intentions. It is probably worth you taking apart the TCPSVR sample app that ships with ICS. It is very well commented. --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/