Home > Software engineering >  As a winsock control array connecting 2000 clients
As a winsock control array connecting 2000 clients

Time:11-09

This several days to see some of the winsock posts, the brain to produce a thought: if a server using winsock control array connection 2000 clients (TCP connection), when the service side want to 2000 when the client sends a string "www.vbgood.com"

For I=1 to 2000
WskServer (I). SendData publishes the event "www.vbgood.com"
Next I

This is too slow, and may result in a concurrent send failure, experts have a good idea? Thank you very much

CodePudding user response:

Sent 2000 messages will be done in a very short period of time, but to maintain normal 2000 connected to this task, is not a simple vb a few lines of code will be able to resist, this is the very high concurrency,

CodePudding user response:

reference 1/X - I - n reply:
sent 2000 messages will be done in a very short period of time, but to maintain normal 2000 connected to this task, is not a simple vb a few lines of code will be able to resist, this is the very high concurrency,
well said!!!!!! Whether to add other DoEvent? Such as:
For I=1 to 2000
WskServer (I). SendData publishes the event "www.vbgood.com"
DoEvent
Next I

CodePudding user response:

DoEvent so scary, or asynchronous, since can't send at the same time, every second hair dozens of,
If too slow, multiple processes, each process to control the amount of 100 or so

CodePudding user response:

This kind of thing is not a VB6 expertise,
Suggest that access to the Internet to find I/o Completion Port (Input/Output Completion Port, the IOCP) related information,
  • Related