您需要采用另一种方式:在事件发生前(您希望向客户端发送新信息来响应它),连接应该保持打开。
You need it the other way around: the connections should remain open until an event arises that you want to respond to by sending new information to the client.
但如果你料想到它会发生——甚至在事情发生前,就把它看作已发生——你就不会那么烦恼了。
And if you expect it to happen-even see it as already happening, before it happens-you won't get so upset.
换句话说,就是试图在问题发生前阻止它。
In other words, trying to stop a problem before it becomes one.
应用推荐