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
Check out ICS which is an internet library which allows you to manage many connections from a single thread. Ideal for your purposes.