zoukankan      html  css  js  c++  java
  • Ratchet(WebSockets for PHP)的官方TUTORIALS 的实践

    前几天稍微看了一下Ratchet,并且实践了一下它官方例子。所以现在就将实践的过程记录下来。

    在具体实践之前先将Ratchet是什么东东,要先说明一下。以下的英文是从官方copy过来的

    Ratchet is a loosely coupled PHP library providing developers with tools to create real time, bi-directional applications between clients and servers over WebSockets。

    具体的Ratchet的介绍可以看他的官方网站 http://socketo.me/

    在开始实践之前,我们还要进行环境的配置

    1 install PHP5.4.x,Apache2.x,Composer

      本人使用zend环境。

    2 安装ZeroMQ

      Download the latest snapshot from http://pecl.php.net/package/zmq/1.1.2/windows

      Copy libzmq.dll into your php directory (e.g. C:endendServerin)  

      Copy the appropriate version of php_zmq.dll to your php extension directory (e.g. C:endendServerlibphpext)  

      Add the following line to your php.ini (e.g. C:endendServeretcphp.ini):  

      extension=php_zmq.dll

      Restart your web server to pickup the ini changes

    3 创建一个PHP工程RatchetSample,建立一个public目录,在public目录下新建一个composer.json文件

    composer.json内容如下

    {
    "require": {
    "cboden/Ratchet": "0.3.*",
    "react/zmq": "*"
    }
    }

    用Composer工具将相应的PHP库下载下来

    通过以上3步应该将开发环境都配置完成了。

    参考官方的TUTORIALS资料分别实现以下2个主题。

    源代码下载地址为:http://download.csdn.net/detail/guoyongrong/6690131

  • 相关阅读:
    Hadoop学习资料收集
    sed使用详解
    shell编程001
    电影《无法触碰》
    正则表达式
    I/O重定向与管道
    bash基础知识
    用户权限模型
    Linux文件管理常用命令
    根文件系统详解
  • 原文地址:https://www.cnblogs.com/guoyongrong/p/3467221.html
Copyright © 2011-2022 走看看