[英]Indy http server questions
I am using indy's http server for a project so i have a few questions: 我正在使用indy的http服务器进行项目,所以我有几个问题:
Thanks. 谢谢。
1. Does the event OnConnect get's executed in a separate thread ? 1. OnConnect事件是否在单独的线程中执行?
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 TIdTCPServer
因此已经使用多线程
it can be used in a main thread context (on a form). 它可以在主线程上下文中使用(在表单上)。
2. Can I update the VCL from the OnConnect event ? 2.我可以从OnConnect事件更新VCL吗?
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. 是的,但您必须使用一些GUI同步实践,例如Synchronize
方法或例如从分离的工作线程到主要工作线程的消息发布。
3. If MaxNumberConnections is set to 0 what does it exactly mean ? 3.如果MaxNumberConnections设置为0,它究竟意味着什么?
Zero value assigned to the MaxConnections
means there is no limit of connections at one time. 分配给MaxConnections
零值意味着一次没有连接限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.