dongyuans61046 2011-09-28 23:01
浏览 24

php socket守护进程,第二个窗口选项卡在广播发送之前不被处理

So I have written a daemon in php and it worked great until I opened two tabs in the same browser and then this error started happening. The 2 tabs were treated as the same socket because when a message is sent the first tab gets the message but the 2nd doesnt until another message is sent. So if 3 tabs are open it alternates between the 3. Is there any way to solve this?

Links to Daemon and Client: Daemon Client Command Line: php z.daemon.php

Just 2 tabbed windows: client.php?action=listen Then run: client.php?action=broadcast&broadcast=test

-- Edit -- Also, the 2nd tab window which is listen does not even show its connected as a client in the commandline output.

-- Edit -- Basically is there a way to send unique ids to socket_select to help it figure out if its a new or not?

  • 写回答

1条回答 默认 最新

  • dongliang1223 2011-09-28 23:14
    关注

    Genreate an random id on page load and use that to identify the individual clients with the query string.

    评论

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退