更新时间:2023-02-15 08:19:23
这听起来像Java 7的 Websocket API 。使用传统的HTTP是不可能的,因为交互遵循请求-响应模式(尽管诸如轮询和长轮询之类的模式也可以达到相同的效果)。 WebSocket允许来自服务器的真实推送通知,因此客户端可以在数据可用时立即接收数据。
This sounds like a job for Java 7's Websocket API. Using traditional HTTP it would not be possible because interactions followed a request-response pattern (although patterns such as polling and long-polling can achieve the same effect). WebSockets allow genuine push notifications from the server, so the client can receive the data as soon as it becomes available.