Persistent connection with client

后端 未结 5 1503
轻奢々
轻奢々 2021-02-08 06:10

Is there a general way to implement part of an application with JavaScript and supplying a persistent connection to a server? I need the server to be able to push data to the cl

5条回答
  •  轮回少年
    2021-02-08 06:45

    You can use Comet programming techniques for this. Basically the page makes a call to the server that doesn't return until the server has something to send (at which point the client immediately makes the same call). This way the server can push content to the client pretty much whenever it wants.

    Support varies depending on platform and is more an issue with the server than the client.

提交回复
热议问题