python websocket server_用Python实现一个简单的WebSocket服务器
2.
數(shù)據(jù)長度在
128-65525
之間時
,
Payload?Length
位設(shè)為
126
,
后面
額外使用
16bit
表
示長度
(
前面的
126
不再是長度的一部分
)
3.
數(shù)據(jù)長度在
65526-2^64-1
之間時
,
Payload?Length
位設(shè)為
127
,
后面
額外使用
64bit
表示長度
(
前面的
127
不再是長度的一部分
)
1.
Fin?(bit?0):?determines?if?this?is?the?last?frame?in?the?message.?This?would?be
set?to?1?on?the?end?of?a?series?of?frames,?or?in?a?single-frame?message,?it?would
be?set?to?1?as?it?is?both?the?first?and?last?frame.
2.
RSV1,?RSV2,?RSV3?(bits?1-3):?these?three?bits?are?reserved?for?websocket
extensions,?and?should?be?0?unless?a?specific?extension?requires?the?use?of?any
of?these?bytes.
3.
Opcode?(bits?4-7):?these?four?bits?deterimine?the?type?of?the?frame.?Control
frames?communicate?WebSocket?state,?while?non-control?frames
communicate?data.?The?various?types?of?codes?include:
1.
x0:?continuation?frame;?this?frame?contains?data?that?should?be?appended?to
the?previous?frame
2.
x1:?text?frame;?this?frame?(and?any?following)?contains?text
3.
x2:?binary?frame;?this?frame?(and?any?following)?contains?binary?data
4.
x3?-?x7:?non-control?reserved?frames;?these?are?reserved?for?possible
websocket?extensions
5.
x8:?close?frame;?this?frame?should?end?the?connection
6.
x9:?ping?frame
7.
xA:?pong?frame
8.
xB?-?xF:?control?reserved?frames
總結(jié)
以上是生活随笔為你收集整理的python websocket server_用Python实现一个简单的WebSocket服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: latex换页_备忘 | Latex 双
- 下一篇: python中elif老是出错_pyth
