本文介绍了Javascript与服务器的TCP连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了服务器守护程序,它会生成一些数据,比如消息等等。但是,我感兴趣的是 - 客户端监控。例如,我有网页,我需要建立与服务器的持久Tcp连接,并将所有传入的数据显示到文本框中。我知道它可以用flash完成,但我正在搜索JS实现。
I have created server daemon, that produces some data, like messages and so. But, what im interested in - client monitoring. For example i have web page, and i need to establish persistent Tcp connection to server and show all incoming data into textbox. I know it can be done with flash, but im searching for JS implementation.
是否有可能以及最佳做法是什么?
Is it possible and what`s the best practices ?
推荐答案您所要求的是 Comet 。存在大量服务器软件和客户端库 - 请参阅链接的维基百科页面。
What you're asking for is known as Comet. Plenty of server software and client libraries exist - see the linked Wikipedia page.
更多推荐
Javascript与服务器的TCP连接
发布评论