CocosCreator WebSocke 是按照RFC标准实现的吧,不用考虑粘包、半包的问题吧?
我大概三年用的时候,没有注意过这个问题
以前用flash和c++通讯处理。后来转H5已经好久不管粘包了。
RFC6455协议,不用自己解决粘包半包了(之前lua/c++甚至还得处理大小端问题),重温了下websocket协议 https://datatracker.ietf.org/doc/html/rfc6455
After a successful handshake, clients and servers transfer data back
and forth in conceptual units referred to in this specification as
"messages". On the wire, a message is composed of one or more
frames. The WebSocket message does not necessarily correspond to a
particular network layer framing, as a fragmented message may be
coalesced or split by an intermediary.
A frame has an associated type. Each frame belonging to the same
message contains the same type of data.
1赞
该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。