I am using indy’s http server for a project so i have a few questions:
- Does the event OnConnect get’s executed even if one connects on a separate thread?
- Can i update the vcl from the event OnConnect
- If MaxNumberConnections is
set to 0 what does it exactly mean ?
Thanks.
1. Does the event OnConnect get’s executed in a separate thread ?
Yes, the event will get fired as the other events do, even if you are running in a separate thread. The question remains to be answered by you is why. The
TIdTCPServeralready uses multithreading thusit can be used in a main thread context (on 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
Synchronizemethod or e.g. message posting from the separated worker thread to your main one.3. If MaxNumberConnections is set to 0 what does it exactly mean ?
Zero value assigned to the
MaxConnectionsmeans there is no limit of connections at one time.