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 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?