dsd57259 2010-04-20 04:24
浏览 52
已采纳

通过TCP / IP接收输入并使用它来更新HTML

This has got to be a FAQ, so can someone please just direct me to a "network programming for dummies" URL?

The server wants to push information to a client or broadcast to all, when an event happens - as opposed to the clients constantly polling the server "just in case". The client then updates a browser page display.

How do I do that? (toldya it was a n00b question)

Should I have a thread which receives info on a socket and then writes it to a database which the browser display (PHP) can process with an HTML refresh tag, or what?

Sorry to sound so dumb.

  • 写回答

4条回答 默认 最新

  • doushuhuai7247 2010-04-20 05:40
    关注

    I think you might be looking for something like comet: http://en.wikipedia.org/wiki/Comet_%28programming%29

    Comet is sort of the opposite of polling, where you have a long-standing HTTP connection, which allows you to push data to the client from the server. Unfortunately, I don't have much to lend other than a link like the one above, but hopefully it will start you in the right direction.

    Some more links that might be helpful:

    https://stackoverflow.com/questions/tagged/comet

    http://ajaxpatterns.org/HTTP_Streaming

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作