Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Apr : Re: writestream() problem..
| Subject: | Re: writestream() problem.. |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Sat, 7 Apr 2007 11:23:29 |
"mustafa korkmaz" <none@none.com> wrote in message
news:4617662c$1@newsgroups.borland.com...
> if the number of users increase cpu usage increase very much..
Only if the clients are sending a lot of data very quickly.
Otherwise, the sleeping that is performed inside of Readable() will
keep the CPU usage down. If 10ms is too fast, then increase it, say
to 100-500ms. But then your outbound queue will slow down a little as
well.
> procedure TMyPeerThread.SendQueue;
You altered the code I gave you. Now, instead of sending all pending
outbound data at one time, you are now sending only 1 stream packet,
leaving the rest unsent until next time. Why did you do that?
> if GetTickCount - StartTime > 3500 then
You are still not calculating the elapsed time correctly. You need to
use the GetTickDiff() function, like I showed you earlier.
Gambit
none