Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
Once a websWebSocketsession is established, messages can be sent unsolicited by either peer at any time. A message is made up of one or more ['messages frames]. Each frame is prefixed with the size of the payload in bytes, followed by the data. A frame also contains a flag (called 'fin') indicating whether or not it is the last frame of the message. When a message is made up from only one frame, it is possible to know immediately what the size of the message will be. Otherwise, the total size of the message can only be determined once the last frame is received.会话建立后,任何一端都可以随时主动发送消息。每条消息由一个或多个消息帧组成。每个帧的前部是有效载荷的字节长度,随后是数据内容。帧还包含一个名为 fin 的标志,用于标识该帧是否为消息的最后一帧。如果消息只由一个帧构成,则可以立即获知消息大小。否则,消息的总大小只能在接收到最后一帧时才能确定。