Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indy http server questions

Tags:

delphi

indy

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.

like image 959
opc0de Avatar asked Feb 19 '26 19:02

opc0de


1 Answers

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 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 MaxConnections means there is no limit of connections at one time.

like image 98
TLama Avatar answered Feb 22 '26 16:02

TLama