Javascript与服务器的TCP连接 [英] Javascript TCP connection to server

查看:924
本文介绍了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连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆