作为客户端接收到的ws内容是乱码?

vasileon

偶发的,接收到的 数据有乱码,并且中间 含有部分正确的数据

recv data before handshake. Buffer:817e017b7b226368616e6e656c223a20226f7264657273222c202274797065223a2022757064617465222c202264617461223a207b226964223a203130383330373635343532332c2022636c69656e744964223a206e756c6c2c20226d61726b6574223a2022544c4d2d50455250222c202274797065223a20226d61726b6574222c202273696465223a2022627579222c20227072696365223a206e756c6c2c202273697a65223a20322e302c2022737461747573223a2022636c6f736564222c202266696c6c656453697a65223a20322e302c202272656d61696e696e6753697a65223a20302e302c20227265647563654f6e6c79223a2066616c73652c20226c69717569646174696f6e223a2066616c73652c202261766746696c6c5072696365223a20302e323631392c2022706f73744f6e6c79223a2066616c73652c2022696f63223a20747275652c2022637265617465644174223a2022323032312d31322d32375431343a30353a32312e3038393431332b30303a3030227d7d817e018a7b226368616e6e656c223a202266696c6c73222c202274797065223a2022757064617465222c202264617461223a207b226964223a20353836343632373130372c20226d61726b6574223a2022544c4d2d50455250222c2022667574757265223a2022544c4d2d50455250222c20226261736543757272656e6379223a206e756c6c2c202271756f746543757272656e6379223a206e756c6c2c202274797065223a20226f72646572222c202273696465223a2022627579222c20227072696365223a20302e323631392c202273697a65223a20322e302c20226f726465724964223a203130383330373635343532332c202274696d65223a2022323032312d31322d32375431343a30353a32312e3134343130372b30303a3030222c202274726164654964223a20323930393636353033352c202266656552617465223a20302e3030303636352c2022666565223a20302e3030303334383332372c202266656543757272656e6379223a2022555344222c20226c6971756964697479223a202274616b6572227d7d817e017c7b226368616e6e656c223a20226f7264657273222c202274797065223a2022757064617465222c202264617461223a207b226964223a203130383330373730363531362c2022636c69656e744964223a206e756c6c2c20226d61726b6574223a2022544c4d2d50455250222c202274797065223a20226d61726b6574222c202273696465223a2022627579222c20227072696365223a206e756c6c2c202273697a65223a20312e302c2022737461747573223a2022636c6f736564222c202266696c6c656453697a65223a20312e302c202272656d61696e696e6753697a65223a20302e302c20227265647563654f6e6c79223a2066616c73652c20226c69717569646174696f6e223a2066616c73652c202261766746696c6c5072696365223a20302e32363138352c2022706f73744f6e6c79223a2066616c73652c2022696f63223a20747275652c2022637265617465644174223a2022323032312d31322d32375431343a30353a33372e3237383435382b30303a3030227d7d
Error package. package_length=falsestring(397) "{"channel": "fills", "type": "update", "data": {"id": 5864631711, "market": "TLM-PERP", "future": "TLM-PERP", "baseCurrency": null, "quoteCurrency": null, "type": "order", "side": "buy", "price": 0.26185, "size": 1.0, "orderId": 108307706516, "time": "2021-12-27T14:05:37.358687+00:00", "tradeId": 2909667329, "feeRate": 0.000665, "fee": 0.00017413025, "feeCurrency": "USD", "liquidity": "taker"}}"
recv data before handshake. Buffer:817e017b7b226368616e6e656c223a20226f7264657273222c202274797065223a2022757064617465222c202264617461223a207b226964223a203130383330373635343532332c2022636c69656e744964223a206e756c6c2c20226d61726b6574223a2022544c4d2d50455250222c202274797065223a20226d61726b6574222c202273696465223a2022627579222c20227072696365223a206e756c6c2c202273697a65223a20322e302c2022737461747573223a2022636c6f736564222c202266696c6c656453697a65223a20322e302c202272656d61696e696e6753697a65223a20302e302c20227265647563654f6e6c79223a2066616c73652c20226c69717569646174696f6e223a2066616c73652c202261766746696c6c5072696365223a20302e323631392c2022706f73744f6e6c79223a2066616c73652c2022696f63223a20747275652c2022637265617465644174223a2022323032312d31322d32375431343a30353a32312e3038393431332b30303a3030227d7d817e018a7b226368616e6e656c223a202266696c6c73222c202274797065223a2022757064617465222c202264617461223a207b226964223a20353836343632373130372c20226d61726b6574223a2022544c4d2d50455250222c2022667574757265223a2022544c4d2d50455250222c20226261736543757272656e6379223a206e756c6c2c202271756f746543757272656e6379223a206e756c6c2c202274797065223a20226f72646572222c202273696465223a2022627579222c20227072696365223a20302e323631392c202273697a65223a20322e302c20226f726465724964223a203130383330373635343532332c202274696d65223a2022323032312d31322d32375431343a30353a32312e3134343130372b30303a3030222c202274726164654964223a20323930393636353033352c202266656552617465223a20302e3030303636352c2022666565223a20302e3030303334383332372c202266656543757272656e6379223a2022555344222c20226c6971756964697479223a202274616b6572227d7d817e017c7b226368616e6e656c223a20226f7264657273222c202274797065223a2022757064617465222c202264617461223a207b226964223a203130383330373730363531362c2022636c69656e744964223a206e756c6c2c20226d61726b6574223a2022544c4d2d50455250222c202274797065223a20226d61726b6574222c202273696465223a2022627579222c20227072696365223a206e756c6c2c202273697a65223a20312e302c2022737461747573223a2022636c6f736564222c202266696c6c656453697a65223a20312e302c202272656d61696e696e6753697a65223a20302e302c20227265647563654f6e6c79223a2066616c73652c20226c69717569646174696f6e223a2066616c73652c202261766746696c6c5072696365223a20302e32363138352c2022706f73744f6e6c79223a2066616c73652c2022696f63223a20747275652c2022637265617465644174223a2022323032312d31322d32375431343a30353a33372e3237383435382b30303a3030227d7d817e018d7b226368616e6e656c223a202266696c6c73222c202274797065223a2022757064617465222c202264617461223a207b226964223a20353836343633313731312c20226d61726b6574223a2022544c4d2d50455250222c2022667574757265223a2022544c4d2d50455250222c20226261736543757272656e6379223a206e756c6c2c202271756f746543757272656e6379223a206e756c6c2c202274797065223a20226f72646572222c202273696465223a2022627579222c20227072696365223a20302e32363138352c202273697a65223a20312e302c20226f726465724964223a203130383330373730363531362c202274696d65223a2022323032312d31322d32375431343a30353a33372e3335383638372b30303a3030222c202274726164654964223a20323930393636373332392c202266656552617465223a20302e3030303636352c2022666565223a20302e30303031373431333032352c202266656543757272656e6379223a2022555344222c20226c6971756964697479223a202274616b6572227d7d
Error package. package_length=falsestring(397) "{"channel": "fills", "type": "update", "data": {"id": 5864631711, "market": "TLM-PERP", "future": "TLM-PERP", "baseCurrency": null, "quoteCurrency": null, "type": "order", "side": "buy", "price": 0.26185, "size": 1.0, "orderId": 108307706516, "time": "2021-12-27T14:05:37.358687+00:00", "tradeId": 2909667329, "feeRate": 0.000665, "fee": 0.00017413025, "feeCurrency": "USD", "liquidity": "taker"}}"
int(3)

2213 1 0
1个回答

walkor 打赏

recv data before handshake websocket没有完成握手,对方就发来了websocket数据,不符合websocket协议流程。
Error package. package_length=false 是对方发来的数据无法解析头部长度,是个错误数据。

  • 暂无评论
年代过于久远,无法发表回答
×
🔝