Home > Software engineering >  [the Iocp model] mass when sending data memory leak problem
[the Iocp model] mass when sending data memory leak problem

Time:09-20

Server using the Iocp model, while the number of host only a few, sending commands to normal, the footprint is normal,,

When the host more than 1000 or more,

The server send SendMsg, previous won't be a problem, but when SendTest many times in a row, the client program memory exponentially increase sharply, takes up more than 10 M program, originally, would have been increased to hundreds of M until collapse..

Here are all the client and server code..

Please answer, thank you,,,



The source code download address:

https://download.csdn.net/download/xxyyzz886/10838592

CodePudding user response:

Any speed of sending and receiving ends inconsistent communication, need to use a large enough between them the FIFO buffer,
The use of any FIFO buffer, are all need to carefully consider the receiver to receive countless overtime according to and the sender sends the FIFO buffer is full in both cases what to do,

CodePudding user response:


99% iocp encapsulates code on the network or even just the demo, there are bugs. Simply means iocp circumstance processing incomplete point, leakage dealt with many details, such as memory leaks

CodePudding user response:

The receiver logic and the buffer size is not allowed to change, the sender to consummate and disconsolate!

CodePudding user response:

You said that the host is refers to the client? Arguably, the client is not visible to other client, the client, the server pressure, the greater the how the client also hang up? I think does not exclude the server problems,
  • Related