|Subject:||[EQ] how can i manage different connection speed ?|
|Posted by:||Ahmadi (Ahmadisolness…@yahoo.com)|
|Date:||Thu, 6 Mar 2008|
i have some clients that are connected to my server.
the clients have different connection speed.some of them are using dialup
connection and other are using 1000mb LAN connection.
i have a main thread that use writebuffer command to send data for the
clients with a delay beetwen writing packets.the delay is a big problem for
me for the following reasons:
a)for the dialup clients is good, but for the LAN clients is bad, because
both have same speed over the network on the my server!
b)i can not remove delay! because writebuffer command can not keep very
amount of data and if i write many data without any delay on the socket.the
writebuffer command will be hang and never comeback(do not reach to next
command)! and all of my client will be suspend for some times!
here is my code (my writer thread in the server ) :
for i := 0 to ClientsCount - 1 do
if assigned(Client) then
if not client^.deleted then
if assigned(Client^.outputBuffer) then
if not Client^.outputBuffer.isEmpty then
s.WriteBuffer(t,sizeof(t)); //**NOTE ** if i write all data
immediately, here i have hang !
if client^.Thread.Connection.Connected then