ServerSocket非阻塞方式就一个线程,没有建立其他线程,看看delphi帮助吧
When ServerType is stNonBlocking, all client connections are handled in a single execution thread by default. OnClientRead or OnClientWrite events occur when the client socket on the other end of one of the connections tries to send or receive information over the connection.
When ServerType is stNonBlocking, all client connections are handled in a single execution thread by default. OnClientRead or OnClientWrite events occur when the client socket on the other end of one of the connections tries to send or receive information over the connection.
关于VCL问题我是在线程里自己建,不过create时它的所属组件设为主窗体,有没有关系?
反正我只会在阻塞Socket方式下不得已采用多线程..在非阻塞方式是ms winsock相对于UNIX之类的SOCKET 一种特色..
不管你再开了多少个线程,它的发送和接收事件触发都是在主线程中,
它相对于阻塞方式,单个线程独立性安全性不强,未必能得到期望的效率。
反正我只会在阻塞Socket方式下不得已采用多线程..在非阻塞方式是ms winsock相对于UNIX之类的SOCKET 一种特色..
不管你再开了多少个线程,它的发送和接收事件触发都是在主线程中,
它相对于阻塞方式,单个线程独立性安全性不强,未必能得到期望的效率。