Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Indy 10: Last information
| Subject: | Indy 10: Last information |
| Posted by: | "David" (microg..@email.it) |
| Date: | Thu, 7 Dec 2006 16:01:56 |
I have 2 little problems with indy components.
1)
If I have the following procedure:
For I := 1 To 10 Do
Begin
TCPClient.IOHandler.WriteLn(Command);
TCPClient.IOHandler.Write(I);
TCPClient.IOHandler.ReadBytes(RI, SizeOf(R));
BytesToRaw(RI, R, SizeOf(R));
Memo1.Lines.Add('Name: '+R.Name);
Memo1.Lines.Add('Info: '+R.Info);
End;
The following records to the number 1 are not correctly read (the value
after the first record is not modified)
But if I create a procedure of external reading to the cycle:
Procedure TForm1.Read( Number : Integer;
Var R : MyRec);
Var
RI : tIdBytes;
Begin
TCPClient.IOHandler.WriteLn(Command);
TCPClient.IOHandler.Write(I);
TCPClient.IOHandler.ReadBytes(RI, SizeOf(R));
BytesToRaw(RI, R, SizeOf(R));
End;
And call it during the cicle:
For I := 1 To 10 Do
Begin
Read(I, R);
Memo1.Lines.Add('Name: '+R.Name);
Memo1.Lines.Add('Info: '+R.Info);
End;
All the records are correctly readed. As it is possible?
2)
If I transfer a file among two computers using a FileStream the speed it
is very very low. How could I increase it?
Thanks,
David