Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : TIdTcpClient / Server and pointer (indy 10)
| Subject: | TIdTcpClient / Server and pointer (indy 10) |
| Posted by: | "Dejan Petrovic" (dejanbng@removethis.ztbclan.com) |
| Date: | Mon, 25 Dec 2006 06:30:44 |
Hi, two questions:
1. there is any method to write pointer to connection ?
for example I would like to write instead :
idTcpClient.IOHandler.Write(myMemoryStream);
idTcpClient.IOHandler.Write(myPointer, pSize);
and to read that on server like pointer too.
for a moment I writing pointer to stream, sending and read from stream once
received.
2. Once stream is sent from idTcpClient to idTcpServer I would like to do
basic cheking and to reply on same connection. For some reason, once stream
is received I can't write back from idTcpServer to client anything. Server
didn't throw any error, this just freeze till client is disconnected :
Something like :
ms := TMemoryStream.Create;
AContext.Connection.IOHandler.ReadStream(ms, -1, true);//this is received ok
ms.Seek(0, soFromBeginning);
GetMem(pData, ms.size);
ms.ReadBuffer(pData^, ms.size);
ms.Free;
AContext.Connection.IOHandler.Write('OK');//this freeze till client is
connected
tnx in advance
Dejan