• 结束握手


    结束握手

    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.
  • 相关阅读:
    python---装饰器用法小结
    python---mysql事务
    python---sql语句集体更改数据
    python多继承中的深度优先与广度优先
    python---copy
    vue 主次页面区分
    css 过渡动画
    android web外壳
    cordova 打包 守护进程无法启动
    JavaScript 原生控制元素添加删除
  • 原文地址:https://www.cnblogs.com/rsapaper/p/12956269.html
Copyright © 2020-2023  润新知