简体   繁体   中英

Indy http server questions

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 TIdTCPServer already uses multithreading thus
it 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 Synchronize method or eg 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 MaxConnections means there is no limit of connections at one time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM