Re: [twsocket] multithread server

2011-08-18 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-18 Thread Wilfried Mestdagh
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. Is it normal? What is property Multithreaded

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

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