Indy Server Questions

I am using indy http server for a project, so I have a few questions:

  • Does the OnConnect event fire even though it connects to a separate thread?
  • Can I update vcl from OnConnect event
  • If MaxNumberConnections is 0, what exactly does this mean?



source to share

1 answer

1. Is the OnConnect event running on a separate thread?

Yes, the event will fire just like other events do, even if you are running in a separate thread. The question is why you need to answer why. TIdTCPServer

already uses multithreading, so it can be used in the context of the main thread (in a form).

2. Can I update the VCL from the OnConnect event?

Yes, but you will have to use some GUI synchronization practice such as Synchronize

or for example posting messages from a split workflow to your main one.

3. If MaxNumberConnections is set to 0, what exactly does this mean?

A value of zero assigned MaxConnections

means that there are no connection restrictions at the same time.



All Articles