Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Francois Piette a écrit : > > That's what I do with my MidWare threaded TServerObject. You can apply the > same logic to the > HttpServer component. > > I have a class which manage a pool of threads. When a request comes in, I get > a thread from the > pool, adding a new one if necessary. The t

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Francois Piette
ary 09, 2006 2:37 PM Subject: Re: [twsocket] [QUESTION] ThttpServer and threading design > Hello Francois, > > Exactly what I do now, but what reference do you pass to thread ? At > beginning I did it with socket.handle (if I remember well by it was > long time ago) by I noti

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Dod
Hello Francois, Exactly what I do now, but what reference do you pass to thread ? At beginning I did it with socket.handle (if I remember well by it was long time ago) by I noticed that if during work job the socket is closed and a new connexion come, then it could happend that this ne

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Francois Piette
> What you're doing is transfering a socket from main thread > context to your work thread context. > My purpose is not the following. What i mean is executing > all the SQL stuff within the thread, > and the connection stuff within the main thread. That's what I do with my MidWare threaded TServe

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Dod a écrit : > Ok so you do nearly same as me. But at the end of threaded job I > verify the client still exists before sending result. > > When a session connect I set a SessionID incremental counter in > MySocketClient class because I noticed that same socket handle can be > re-us

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Dod
Hello Guillaume, Ok so you do nearly same as me. But at the end of threaded job I verify the client still exists before sending result. When a session connect I set a SessionID incremental counter in MySocketClient class because I noticed that same socket handle can be re-used by a

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Dod a écrit : > 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 thr

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Dod
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 clientso

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
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. True ! i haven't see

Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Bjørnar Nielsen
at the same time. Regards Bjørnar > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Guillaume MAISON > Sent: 9. februar 2006 10:59 > To: ICS support mailing > Subject: [twsocket] [QUESTION] ThttpServer and threading design > >

[twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Hi everyone, i've an application to write, a client and a server. i've choosen to use the HTTP protocol to enable communication through them. Hence, i'll use the THttpServer as my server front-end. my question is the following : some requests may use some database stuff (SQLite). It shouldn't be