websocket intro

The Websocket Protocol

  • Introduction

    • Background

      • variety of problem
        • The server is forced to use a number of different underlying TCP connections for each client: one for sending information to the client and a new one for each incoming message.
        • The wire protocol has a high overhead, with each client-to-server message having an HTTP header.
        • The client-side script is forced to maintain a mapping from the outgoing connections to the incoming connection to track replies.
    • Protocol Overview

      • The protocol has two parts: a handshake and the data transfer.
        • The handshake from the client looks as follows
          1

  • publisher-subscriber server
    • (as known as a bus, message broker, or event-channel)
      • receive notifications about state changes on the one hand, and subscriptions for such notifications on the other.

websocket

参考文档

[]