How to Listen 1200 devices [closed]

2020-03-08 07:10发布

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)

标签: delphi
2条回答
我只想做你的唯一
2楼-- · 2020-03-08 07:33

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

查看更多
放我归山
3楼-- · 2020-03-08 07:50

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

查看更多
登录 后发表回答