Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Feb : writebuffer, writestream wait problem
| Subject: | writebuffer, writestream wait problem |
| Posted by: | "writebuffer, writestream wait problem" (sekendizpa..@yahoo.com) |
| Date: | 27 Feb 2007 14:48:14 |
If my server program wants to send any data to client it adds one task to task list of writerthread.
All writing processes are managed by writerthread.
So it prevents to write data to one connection at the same time .
Buffer: array[ 1..1400 ] of char;
..............
var mytime:cardinal;
mytime := Gettickcount;
try
Athread.conection.writebuffer(buffer, mylength);
except
end;
if gettickcount - mytime > 4000 then WaitToLog(...);
............................................
stream: Tmemorystream;
..............
var mytime:cardinal;
mytime := Gettickcount;
try
Athread.conection.writestream(stream);
except
end;
if gettickcount - mytime > 4000 then WaitToLog(...);
I use delphi5,indy 9.0.18
I use Tidtcpserver component.
My server program runing on windows 2003 server.
Max size of stream size is 5000 bytes.My server has two cpu.
And cpu usage was %20, there was 1.5 Gb available Ram while this program runs.
My server has 4 Mbit bandwith.And it only use max 2 Mbit.
some times Writestream or writebuffer commands completes in 40000 ms. times.(some times 65000 ms.,7000 ms.)
It is very long time for my application...
What is the problem?