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.
  • 相关阅读:
    MAC使用小技巧(二)
    Swift # GET&POST请求 网络缓存的简单处理
    iOS:Block写递归
    Swift # 项目框架
    uva 11665 Chinese Ink (几何+并查集)
    uva 11859 Division Game
    uva 11916 Emoogle Grid (BSGS)
    uva 11754 Code Feat (中国剩余定理)
    hdu 4347 The Closest M Points(KD树)
    2013多校训练赛第四场 总结
  • 原文地址:https://www.cnblogs.com/rsapaper/p/12956269.html
Copyright © 2011-2022 走看看