Sdean
Sdean

Reputation: 247

Does IdSchedulerOfThreadPool limit the simultaneous-connection count?

If I assign an TIdSchedulerOfThreadPool to my IdTCPServer, will I still be limited to the number of simultaneous connections?

My IdTCPServer properties are :

 ListenQueue : 30
   MaxConnections : 0
   ReuseSocket rsTrue
   Scheduler :MyIdSchedulerOfThreadPool
   TerminateWaitTime : 5000

MyIdSchedulerOfThreadPool's properties :

Scheduler: MyIdSchedulerOfThreadPool
MaxThreads = 0
PoolSize = 0
ThreqdPriority = tpNormal

No coding; I just assign the MyIdSchedulerOfThreadPool to Scheduler.


Upvotes: 0

Views: 914

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 596958

The TIdTCPServer.MaxConnections property controls how many simultaneous clients are allowed to be connected at a time.

The TIdSchedulerOfThread.MaxThreads property controls how many simultaneous threads are allowed to be running at a time (idle or otherwise).

The TIdSchedulerOfThreadPool.PoolSize property controls how many simultaneous idle threads are allowed to be in the pool at a time.

So when you have a TIdSchedulerOfThread... assigned, the max number of simultaneous connections is really the smaller value between the MaxConnections and MaxThreads properties, since each client connection requires a thread to manage it.

Upvotes: 2

Related Questions