douxunwei7083 2015-01-27 20:26
浏览 32

带有PHP应用程序的节点js和socket io

I have been looking all over at various turtorials, videos and blogs but i havent seem to find an answer to my question:

Say you have a web application in a traditional framework (such as cakephp or other PHPframework)

Normally these will be build using MVC (Model view controller)

Now say we have our helloWorld application.

The first encouter for the client to the applicatoin might be: www.helloWorld/Client/index

According to the tutorials the of socket IO and node js the client will at this point make a connection to the server (the client connects to the socket).

The script that connects to the socket might be put into a layout file making sure that no matter where the user is he is always connected to the server.

Here comes the part i do not understand. if the client changes page wont he reconnect to the server at every page change? or is the nodejs and socket IO smart enough to know that it is on the same server? if so how do you make an application where the client is connected to a socket for as long as he is on your website?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测