Analysis of the connection queue backlog for Linux socket

Source: Internet
Author: User
Tags ack

Linux in the socket connection queue definition processing on the personal feel is a little pit dad, gossip less, direct talk.


To establish the socket connection process:

1.client sends a SYN request to the server

2.server received after the request is stored in the SYN queue, the maximum value of this half-connection queue is defined by the system parameter Tcp_max_syn_backlog

3. Store in the semi-connected queue after sending Syn+ack to Client,client received and then send Syn+ack to the server to complete three handshake, and then the server to store the connection in the Accept queue, This queue length is the size of the backlog definition defined when the socket is called in the program.

4. The application obtains the connection by calling accept () into the Accept queue.

The features of the pit daddy come! Attention!

What happens when the Accept queue is full?

!! Attention! If the Accept queue is full, Linux will have an exception handler to determine if the Tcp_abort_on_overflow system parameter is 1, and if 1, a denial-of-client termination message is issued and the connection is disconnected. But if this parameter is 0, then the pit Daddy! , the connection to the overflow queue, Linux will not go to it, will continue to establish a normal connection, but not in the accept queue, which means that your program with the Accept () function can not take the connection! This is how the pit father Ah!!! There's no reason to find out, okay?!! All sorts of being misled good!!! Hey, Linux!!

This article from "Dalian People in Beijing" blog, declined to reprint!

Analysis of the connection queue backlog for Linux socket

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.