> I've come to 2 ideas:
>
> - set up a secondary thread for ICS (but I already have several
>  threads running... ;-))

That's OK. You may set the thread priority above normal level so that the 
network I/O doesn't catch all available CPU. It looks like you have a CPU 
bound case.

> - in OnDataAvailabe check whether at least 1 sec. has been elapsed and
>  the manually call OnTimer.

That's a possibility.

You may also want to try wsoNoReceiveLoop in TWSocket.Options.


--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


----- Original Message ----- 
From: "Markus Humm" <[EMAIL PROTECTED]>
To: "ICS support mailing" <[email protected]>
Sent: Friday, October 27, 2006 5:35 PM
Subject: [twsocket] Large amount of OnDataAvailable calls and 
timer/frozenmain thread


> Hello,
>
> I've the following case:
>
> - VCL mainform with a timer which updates some statistics shown
>  once a second
> - TWSocket as TCP-Server which gets requests from a client
> - if the client sends requests as a huge bulk
>  (e.g. 10.000 requests in a relatively [not completely] tight loop)
>  the statistics don't get updated for a while
>
> I know that TTimer uses windows messages as well as ICS and now I'm
> looking for a way to decouple my statistic update and the receiving of
> data (CPU load get's to 100% in this worst case scenario).
>
> I've come to 2 ideas:
>
> - set up a secondary thread for ICS (but I already have several
>  threads running... ;-))
> - in OnDataAvailabe check whether at least 1 sec. has been elapsed and
>  the manually call OnTimer.
>
> I'd be especially fond of the second approach but like to know whether
> this can work. (can't just try it since I'm not in the office right now)
>
> Greetings
>
> Markus
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to