Re: [twsocket] multithread server

2011-08-18 Thread Wilfried Mestdagh
Hi Lukas, > version 1: incoming data are received in main thread and are written to > buffer of client, client has own thread to process data in buffer > version 2: data are received in client thread (in same way as in demo > thread application) Possible you have a trhead problem. Possible a thre

Re: [twsocket] multithread server

2011-08-18 Thread Angus Robertson - Magenta Systems Ltd
> there are about 150 clients (in average) connected at the same > time. sometimes program hang after 15 minutes of running, sometimes > after several hours. I've had ICS servers running for several months without hanging, but not with as many clients. Is the client an ICS application, or som

Re: [twsocket] multithread server

2011-08-18 Thread Lukáš Skála
hi, thank for reply. there are about 150 clients (in average) connected at the same time. sometimes program hang after 15 minutes of running, sometimes after several hours. I think there is no memory problem because server has a lot of memory and when I check it using taskmanager there is a

Re: [twsocket] multithread server

2011-08-18 Thread Wilfried Mestdagh
s.org] > Namens Lukáš Skála > Verzonden: donderdag 18 augustus 2011 8:05 > Aan: twsocket@elists.org > Onderwerp: Re: [twsocket] multithread server > > hi, > I always call Receive (even if RcvdCount returns zero). When RcvdCount > returns zero then Receive returns -1 value. I

Re: [twsocket] multithread server

2011-08-17 Thread Lukáš Skála
hi, I always call Receive (even if RcvdCount returns zero). When RcvdCount returns zero then Receive returns -1 value. Is it normal? What is property Multithreaded in TWServerSocket? Should it be set to TRUE? In demo application property is set to FALSE and only client sockets are set to TRUE.

Re: [twsocket] multithread server

2011-08-17 Thread Wilfried Mestdagh
Hi, If OnDataAvailable triggers then you have to try to receive data, even if RcvdCount (wich is unreliable) returns 0. If you don't receive then OnDataAvailable will be called again in a closed loop en that is probably what happens. -- mvg, Wilfried http://www.mestdagh.biz http://www.comfort

Re: [twsocket] multithread server

2011-08-17 Thread Francois PIETTE
Sometimes Windows triggers OnDataAvailable when no data is actually available. This is how it works. It is safe to ignore it. The most important is to call Recv (or any derivative) anyway. Using RcvdCount to decide to call or no Recv is wrong. Always call Recv which is the only one to actually