Hello Guillaume,

Until know what I use to do is to create a worker thread and send jobs
(with  pointer  to  socket  client object) and then worker send back a
message  to socket thread with pointer of data to send back to client.
So all socket things is done from same thread.

Dettaching  clientsocket  from  socket thread to attach it into worker
thread when starting lenghty operation is something I never did.

I have one question regarding this... if some socket event come during
the  lengthly operation (OnDisconnect or OnDataAvailable for example),
will  they  be  triggered  during  operation or only at end of it ?

If  socket is MultiThread:=true it should use its own message queue so
react  instantly whenever the thread it is attached into is busy isn't
it ?


GM> Bjørnar Nielsen a écrit :
>> I have a similar design, but I also have a pointer to the thread in the
>> THttpConnection so that the connection can set a flag on the thread if the
>> connection is dropped before the thread has finished the work and risk using
>> a freed connection.

GM> True ! i haven't seen it !

>> This design could serve several connections/threads at the same time.

GM> Thanks a lot !

GM> -- 

GM> Guillaume MAISON - [EMAIL PROTECTED]
GM> 83, Cours Victor Hugo
GM> 47000 AGEN
GM> Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
GM> e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
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