我后台用的是 python 库中的一个 websocket 模块 simplewebsocketserver https://github.com/dpallot/simple-websocket-server ,在收到前台命令之后,会一次发送几十条数据:主要就是在 handleMessage 函数中循环调用 sendlemessage 函数,但是我发现在调用之后数据包并没有立即发送给 web 页面啊。这些数据实际上也的确是分开发送的,所以我怀疑是不是在退出 handlemessage 函数退出之后才开始发送数据?我想实现的就是立即发送给页面,不用等待。谢谢大家了。