<i id='Yjm8P'><tr id='Yjm8P'><dt id='Yjm8P'><q id='Yjm8P'><span id='Yjm8P'><b id='Yjm8P'><form id='Yjm8P'><ins id='Yjm8P'></ins><ul id='Yjm8P'></ul><sub id='Yjm8P'></sub></form><legend id='Yjm8P'></legend><bdo id='Yjm8P'><pre id='Yjm8P'><center id='Yjm8P'></center></pre></bdo></b><th id='Yjm8P'></th></span></q></dt></tr></i><div id='Yjm8P'><tfoot id='Yjm8P'></tfoot><dl id='Yjm8P'><fieldset id='Yjm8P'></fieldset></dl></div>

<small id='Yjm8P'></small><noframes id='Yjm8P'>

  • <legend id='Yjm8P'><style id='Yjm8P'><dir id='Yjm8P'><q id='Yjm8P'></q></dir></style></legend>

    • <bdo id='Yjm8P'></bdo><ul id='Yjm8P'></ul>

      <tfoot id='Yjm8P'></tfoot>

        使用 PHP 在 Laravel 上的 mqtt

        mqtt on Laravel with PHP(使用 PHP 在 Laravel 上的 mqtt)

        <i id='xrQWl'><tr id='xrQWl'><dt id='xrQWl'><q id='xrQWl'><span id='xrQWl'><b id='xrQWl'><form id='xrQWl'><ins id='xrQWl'></ins><ul id='xrQWl'></ul><sub id='xrQWl'></sub></form><legend id='xrQWl'></legend><bdo id='xrQWl'><pre id='xrQWl'><center id='xrQWl'></center></pre></bdo></b><th id='xrQWl'></th></span></q></dt></tr></i><div id='xrQWl'><tfoot id='xrQWl'></tfoot><dl id='xrQWl'><fieldset id='xrQWl'></fieldset></dl></div>
                <tbody id='xrQWl'></tbody>
              <tfoot id='xrQWl'></tfoot>
            1. <legend id='xrQWl'><style id='xrQWl'><dir id='xrQWl'><q id='xrQWl'></q></dir></style></legend>
                <bdo id='xrQWl'></bdo><ul id='xrQWl'></ul>

                <small id='xrQWl'></small><noframes id='xrQWl'>

                  本文介绍了使用 PHP 在 Laravel 上的 mqtt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在我的 raspberry 和我的 Ubuntu 上使用 MQTT.我使用终端作为开始订阅者和发布者,它运行良好.但是现在我想创建一个具有此功能的网站(使用 laravel).我用谷歌搜索了它,但我没有发现任何有趣的东西.有可能吗?怎么做?

                  I'm using the MQTT on my raspberry and on my Ubuntu. I use terminal for start subscriber and publisher and it works so good. But now I want to create a website (using laravel) with this features. I googled it, but I don't find anything interesting. Is it possible to do and how?

                  推荐答案

                  与 HTTP 不同,MQTT 通常用于在应用程序进程和 MQTT 服务器之间打开长时间运行的连接.

                  Unlike with HTTP, MQTT is typically used by opening a long-running connection between an application process and a MQTT server.

                  虽然完全有可能打开一个连接,发布一条消息,然后再次关闭套接字,但它并不能真正用于订阅消息流.

                  While it is perfectly possible to open a connection, publish a single message and then close the socket again, it doesn't really work for subscribing to a stream of messages.

                  PHP 的典型操作模式是启动一个进程,等待 HTTP 连接,处理请求,然后启动一个新进程.这与具有长时间运行进程的典型 MQTT 模式不太匹配.

                  PHP's typically mode of operation is to start a process, wait for an HTTP connection, handle the request and then start a new process. This doesn't fit well with the typical MQTT mode of having a long-running process.

                  随着人们使用 PHP 内置 HTTP 服务器,这种情况开始发生变化.我不确定 Laravel 是否提供了一种机制来在处理请求之间保持变量/TCP 连接.

                  This had started to change with people using the PHP built-in HTTP server. I am not sure if Laravel provides a mechanism to keep variables/TCP connections in place between handling requests.

                  或者,可以在长时间运行的 CLI PHP 脚本中订阅 MQTT 主题并将其保留在本地(例如数据库、KV 存储、memcache、redis),然后提供来自数据存储的数据.

                  Alternatively it is possible to subscribe to a MQTT topic in a long-running CLI PHP script and persisting it locally (for example a database, KV store, memcache, redis) and then serving the data from the datastore.

                  这在很大程度上取决于您要实现的目标.

                  It depends a lot on what you are trying to achieve.

                  这篇关于使用 PHP 在 Laravel 上的 mqtt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                  Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                  PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                  How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                  get a # from a url in php(从 php 中的 url 获取 #)
                  PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)
                    <bdo id='ljolk'></bdo><ul id='ljolk'></ul>
                    <i id='ljolk'><tr id='ljolk'><dt id='ljolk'><q id='ljolk'><span id='ljolk'><b id='ljolk'><form id='ljolk'><ins id='ljolk'></ins><ul id='ljolk'></ul><sub id='ljolk'></sub></form><legend id='ljolk'></legend><bdo id='ljolk'><pre id='ljolk'><center id='ljolk'></center></pre></bdo></b><th id='ljolk'></th></span></q></dt></tr></i><div id='ljolk'><tfoot id='ljolk'></tfoot><dl id='ljolk'><fieldset id='ljolk'></fieldset></dl></div>
                    <legend id='ljolk'><style id='ljolk'><dir id='ljolk'><q id='ljolk'></q></dir></style></legend>
                  • <small id='ljolk'></small><noframes id='ljolk'>

                      • <tfoot id='ljolk'></tfoot>
                            <tbody id='ljolk'></tbody>