如何听1200设备 [英] How to Listen 1200 devices
问题描述
我有一个设备。
设备有以太网卡。我给一个ip地址和端口设备(服务器ip地址)。
设备每秒向tcp / ip发送数据到服务器。
我必须从服务器监听设备。我有1200个设备
什么是最好的方式从一台服务器听1200设备?
(多线程或另一种方式)
事件驱动的服务器是一个要求。
忘记关于Indy,并使用事件驱动(也称为I / O完成)IP服务器。
Windows限制是大约2000个线程的32位,因为每个线程保留2 MB的堆栈空间,AFAIR。像Indy这样的服务器将每个连接使用一个线程,所以这只会浪费很多资源。
根据设计, I / O完成允许将所有传入的请求平衡到一个小的线程池。请参阅是否有针对Delphi的I / O完成端口组件和可扩展的Delphi TCP服务器实现
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)
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
这篇关于如何听1200设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!