CodePudding user response:
Idtcpsever himself has a multithreading is blocked, however, in the order of magnitude smaller concurrent access, directly in idtcpsever excute method to deal with conflict of resource accessCodePudding user response:
Consult the socket example here:http://download.csdn.net/detail/geoff08zhang/4571358
CodePudding user response:
With idtcpserver, synchronous development is convenient, but is not suitable for processing a large number of client connections, because inside is a link to a thread processing, thread is wasted too much time on the thread,Or processing can use message pattern or patterns of events, under Windows iocp is one of the best performance,
CodePudding user response:
1000 connections, it estimated difficultCodePudding user response:
It depends on your work environment is a LAN or wan, if it is a local area network (LAN), perhaps you can use the UDP way from server to all clients broadcast, it depends on what your application is, UDP broadcasts is the most efficient way,If you wan, you won't be able to use UDP broadcast, as the upstairs said, want to support 1000 connections in a TCP way is difficult, a accommodating way is to use multiple ports connect 1000 spread out, but your server must support multiple ports,
CodePudding user response:
Tcpsever can connect multiple clients,You first create a fifo circular buffer, and then create a buffer for each client, to save the data to the corresponding buffer, and then doing a separate thread to handle the data in the buffer.
CodePudding user response:
1000 connections to go asynchronously, using the iocp model easily support,CodePudding user response:
IdTCPServer can also get 1000 linksCodePudding user response:
IdTCPServer blocking mode, 1000 connections will be 1000 threads, the operating system on the threads of a context switch is a huge cost, let alone or the server side, you also provide a lot of computing services,