Einzelnen Beitrag anzeigen

Torsten Borstensohn

Registriert seit: 1. Jul 2004
Ort: Remscheid
8 Beiträge
 
Delphi 3 Professional
 
#40

Re: chat funktioniert nicht übers inet =(

  Alt 4. Jul 2004, 14:32
Der Server muss für jede Anfrage eines Client einen neuen Thread bilden:

http://www.howtodothings.com/showart...sp?article=522

"How do we handle more than one client requests at a time?

The answer is to spawn a new thread for each client request. This can be achieved by setting the ServerType property to stThreadBlocking. Does spawning and destroying a thread for each client request an overhead? Yes. Obviously. But if our application design requires it, then there is no other way; you have to have that overhead. Can we reduce that overhead of creating and destroying threads? Yes. We can. How? Cache those threads. Right.
The ThreadCacheSize property serves that purpose. The default value is 10 but this value depends on your client application needs. You should be very careful in setting this value. If you set it to a maximum value, you will end up in memory problems. If you set it to a very low value, the client will have a wait time for each request. So you have to determine a best value based on the client statistics.

If the client requests are coming one at a time, then you can set the ServerType property to stNonBlocking."
  Mit Zitat antworten Zitat