zoukankan      html  css  js  c++  java
  • 结束握手

    结束握手

    https://tools.ietf.org/html/rfc6455#section-1.8

    1.4. Closing Handshake

    
    
       _This section is non-normative._
    
       The closing handshake is far simpler than the opening handshake.
    
       Either peer can send a control frame with data containing a specified
       control sequence to begin the closing handshake (detailed in
       Section 5.5.1).  Upon receiving such a frame, the other peer sends a
       Close frame in response, if it hasn't already sent one.  Upon
       receiving _that_ control frame, the first peer then closes the
       connection, safe in the knowledge that no further data is
       forthcoming.
    
       After sending a control frame indicating the connection should be
       closed, a peer does not send any further data; after receiving a
       control frame indicating the connection should be closed, a peer
       discards any further data received.
    
       It is safe for both peers to initiate this handshake simultaneously.
    
       The closing handshake is intended to complement the TCP closing
       handshake (FIN/ACK), on the basis that the TCP closing handshake is
       not always reliable end-to-end, especially in the presence of
       intercepting proxies and other intermediaries.
    
       By sending a Close frame and waiting for a Close frame in response,
       certain cases are avoided where data may be unnecessarily lost.  For
       instance, on some platforms, if a socket is closed with data in the
       receive queue, a RST packet is sent, which will then cause recv() to
       fail for the party that received the RST, even if there was data
       waiting to be read.
  • 相关阅读:
    scrapy框架持久化存储 以及响应参数
    scrapy框架
    12306 模拟登陆
    Python第三库---requests库详解
    批处理-----4.for循环中的变量
    批处理-----3. for循环详解
    批处理-----2.常用特殊符号
    批处理-----1.内部命令简介
    Python第三方库---requests库
    Python 自带标准库
  • 原文地址:https://www.cnblogs.com/rsapaper/p/12956269.html
Copyright © 2011-2022 走看看