How to Listen 1200 devices [closed]

时光总嘲笑我的痴心妄想 提交于 2019-12-30 07:51:28

问题


I am using Delphi I have a device. Device has ethernet card.I give a ip adress and port to device(Server ip adress). Device send data with tcp/ip every second to server.

I have to Listen device from Server.I have 1200 devices What is the best way listen 1200 device from one server? (Multi thread or another way)


回答1:


Event-driven server is a requirement here.

Forget about Indy, and use an event-driven (aka over I/O completion) IP server.

Windows limit is around 2000 threads for 32 bit, since each thread reserves 2 MB of stack space, AFAIR. A server like Indy will use one thread per connection, so it will be just a big waste of resources.

By design, I/O completion allows to balance all the incoming requests to a small thread pool. See Is there a I/O completion port based component for Delphi? and Scalable Delphi TCP server implementation




回答2:


Check out ICS which is an internet library which allows you to manage many connections from a single thread. Ideal for your purposes.



来源:https://stackoverflow.com/questions/15924616/how-to-listen-1200-devices

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!