zoukankan      html  css  js  c++  java
  • TCP协议中的Push标志位

    原:

    The push flag tells the receiving end of the tcp connection to "push" all buffered data to the receiving application. It basically says "done for now".

    译:

    Push标志位通知TCP连接的接收方, 让它把所有缓存的数据给"push"到接收端的应用程序里去. 这个flag的意思基本上就是"传好了, 现在, 让你的应用程序先处理一下我传来的这些数据吧".

    更多:

    The Push flag, like the Urgent flag, exists to ensure that the data is given the priority (that it deserves) and is processed at the sending or receiving end. This particular flag is used quite frequently at the beginning and end of a data transfer, affecting the way the data is handled at both ends.

    When a host sends its data, it is temporarily queued in the TCP buffer, a special area in the memory, until the segment has reached a certain size and is then sent to the receiver. This design guarantees that the data transfer is as efficient as possible, without waisting time and bandwidth by creating multiple segments, but combining them into one or more larger ones.

     

    When the segment arrives at the receiving end, it is placed in the TCP incoming buffer before it is passed onto the application layer. The data queued in the incoming buffer will remain there until the other segments arrive and, once this is complete, the data is passed to the application layer that's waiting for it.

    While this procedure works well in most cases, there are a lot of instances where this 'queueing' of data is undesirable because any delay during queuing can cause problems to the waiting application. A simple example would be a TCP stream, e.g real player, where data must be sent and processed (by the receiver) immediately to ensure a smooth stream without any cut offs.

     

    A final point to mention here is that the Push flag is usually set on the last segment of a file to prevent buffer deadlocks. It is also seen when used to send HTTP or other types of requests through a proxy - ensuring the request is handled appropriately and effectively.

    资料来源:

    The TCP Datagram

    http://www.daemon.org/tcp.html 

    TCP Analysis - Section 4:TCP Flag Options

    http://www.firewall.cx/tcp-analysis-section-4.php

  • 相关阅读:
    [leetcode]791. Custom Sort String自定义排序字符串
    [leetcode]304. Range Sum Query 2D
    [leetcode]339. Nested List Weight Sum嵌套列表加权和
    [leetcode]81. Search in Rotated Sorted Array II旋转过有序数组里找目标值II(有重)
    [leetcode]170. Two Sum III
    [leetcode]341. Flatten Nested List Iterator展开嵌套列表的迭代器
    [leetcode]445. Add Two Numbers II 两数相加II
    Node 连接mysql数据库
    Restful 表述性状态传递
    node Express 框架
  • 原文地址:https://www.cnblogs.com/awpatp/p/1841898.html
Copyright © 2011-2022 走看看