Closed yan990703 closed 1 month ago
This is likely because you are sending an empty binary payload in your last emit. The sync websocket client does not like empty binary packets, it decides the connection has died. The async websocket client does not have this limitation.
这可能是因为您在上次发出时发送了一个空的二进制有效负载。同步 websocket 客户端不喜欢空的二进制数据包,它认为连接已死亡。异步 websocket 客户端没有此限制。
I see, I do send an empty binary as the flag bit after each send! Thank you very much
Describe the bug "socketio.Client" always disconnects automatically after receiving data sent by the server "send_file" event, and then triggers the automatic reconnection mechanism. This has nothing to do with the size of the file, even a text file with only one or two characters can trigger the file. Clients created using "socketio.AsyncClient" will not have this problem.
To Reproduce Steps to reproduce the behavior:
Using the above code, sending a file's byte type data to the "send_file" event triggers the problem, and you can see a log like this
Expected behavior A clear and concise description of what you expected to happen.
Logs
This is Client Logs
This is Server Logs
Additional context I have provided two files, which create the client in AsyncClient and Client respectively. They receive the same data in the send_file event, and the client created by AsyncClient will not be disconnected.
SimpleClient.txt
AsyncClient.txt