Diocp open-source project-diocp3 Rewrite notes-1

Source: Internet
Author: User

In the past few days, we have re-installed diocp3, and the basic work has been initially completed. In the testing phase, we joined the queue for delivery today. This is a very simple job. I did not pay attention to it and left two traps, after 7 to 8 hours, I found the problem and recorded it,

About the queuing delivery process

This is the process of delivering a tiocpsendrequest. The delivery starts and delivers a piece of data, up to 50 k. If it exceeds 50 K, it will be delivered in batches. The process is correct. My first statement is:

Innerpostrequest ships the sent data to the iocp queue. After the shipping is completed, the memory block postion is added to facilitate the next delivery. It seems that there is no problem. If the network condition is quite good, especially on the local machine, the other thread completes the event immediately after delivery <when the fposition is determined in the content, it is still accumulated, the cup is generated a little bit>. Now that you know the cause, you can solve the problem.

 

Modify. postion increases will not be processed here and will be processed in handleresponse.

After the data is sent, add fpostion and determine whether there is any remaining data to be sent. Finally, we have completed this trap.

 

Another sentence: "Concurrent Design: never suppose that any code will be executed continuously"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.