How to implement the time of the last action on the event and then check
OnDataAvailable?


2013/4/30 {Dark_Ducke} <darkdu...@gmail.com>

> Thank you, you are helping me a lot, the client connects makes the request
> and disconnects, does not keep the connection active for over 20s, this way
> I will continue using TWSocket and I will check the time of the last
> activity of each client connected and disconnect case has passed the
> connection timeout, I'm doing based on the example "MtSrv", would be the
> best for my case?
>
> Thank you for your attention and help!
>
>
> 2013/4/30 François Piette <francois.pie...@skynet.be>
>
>> > WSocket only with WSocketServer WSocketThrdServer and that this problem
>> occurs, it takes is
>> > a message exchange (string) between client and server with multiple
>> clients connected
>> > simultaneously, the problem with the component WSocket that is working
>> is
>> that if a
>> > customer taking disconnect the network cable, I can not check if there
>> is
>> a socket opened
>> > in ClientThread to destroy it and thereby leaving many threads created
>> without ...
>>
>> Is this the same issue as the one related in your previous message ? It
>> seems not. But this looks closer to the subject.
>>
>> To close inactive clients, the easiest way is to record the last time a
>> client sent a request and periodically check the client list and close all
>> client which had no more activity since a give amount of time.
>>
>> By the way, why are you using a multithread version ? usually, multithread
>> applied to simply do not scale very well. Using ICS, properly, you can
>> usually serve hundreds of client with only a single thread. It is a bad
>> idea
>> to create a thread for each client, especially if most client are not
>> really
>> active.
>>
>> You should create a thread only to execute lengthy requests a client may
>> send. Any request which execute fast should not have his own thread. And
>> of
>> course, you should not create and destroy threads but instead a thread
>> pool.
>>
>> Correctly handling multithreading is frequently difficult for the
>> unexperimented multithreading developer.
>>
>> All this being said, I have not enough information to be able to give you
>> better advice. I can only stay general.
>>
>> --
>> francois.pie...@overbyte.be
>> Embarcadero MVP
>> http://www.overbyte.be
>> http://francois-piette.blogspot.com
>>
>>
>>
>>
>>
>>
>>
>> --
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>>
>
>
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to