{"id":13462573,"url":"https://github.com/lixuancn/MeepoPS","last_synced_at":"2025-03-25T01:32:20.764Z","repository":{"id":76797754,"uuid":"54094809","full_name":"lixuancn/MeepoPS","owner":"lixuancn","description":"MeepoPS是Meepo PHP Socket的缩写，旨在提供稳定的Socket服务。可以轻松构建在线实时聊天、即时游戏、视频流媒体播放等。","archived":false,"fork":false,"pushed_at":"2020-12-16T07:26:12.000Z","size":4091,"stargazers_count":503,"open_issues_count":0,"forks_count":137,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-03-22T07:05:51.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://meepops.lanecn.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lixuancn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-17T06:40:01.000Z","updated_at":"2025-03-21T06:20:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"671f1e13-e1a6-4c5f-bc7a-937f3a3ebbf4","html_url":"https://github.com/lixuancn/MeepoPS","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixuancn%2FMeepoPS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixuancn%2FMeepoPS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixuancn%2FMeepoPS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixuancn%2FMeepoPS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lixuancn","download_url":"https://codeload.github.com/lixuancn/MeepoPS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245382200,"owners_count":20606170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T12:00:52.405Z","updated_at":"2025-03-25T01:32:20.408Z","avatar_url":"https://github.com/lixuancn.png","language":"PHP","funding_links":[],"categories":["Uncategorized","PHP","基础框架"],"sub_categories":["Uncategorized","构建/部署"],"readme":"# MeepoPS\n###### MeepoPS是Meepo PHP Socket的缩写. 旨在提供高效稳定的由纯PHP开发的多进程SocketService.\n###### MeepoPS可以轻松构建在线实时聊天, 即时游戏, 视频流媒体播放, RPC, 实时监控, 以及原本使用HTTP的接口/定时任务的场景中等.\n\n#### 综述:\n- 目前版本为V1.0.0 ( [查看改动日志](http://meepops.lanecn.com/doc/main/1-summary/7-update-log.html) ).\n- PHP作为最好的语言, 不仅仅能依靠Nginx来开发Web应用, 同时,也可以构建高效稳定的即时通讯类Socket应用.\n- MeepoPS的最低运行要求是安装了PHP的PCNTL库.\n- MeepoPS的定位是一个插件. 不但可以独立运行, 也可以依附与ThinkPHP, CodeIgniter, YII等MVC框架中.\n\n#### 传送门:\n- 手册地址: http://meepops.lanecn.com\n- Github: https://github.com/lixuancn/MeepoPS\n- Bug提交: https://github.com/lixuancn/MeepoPS/issues\n- 微博: http://weibo.com/lanephp\n\n#### 声明:\n- 绝大多数的PHP应用都部署在Linux服务器, 因此MeepoPS不支持非Unix操作系统(例如Windows). 你可以使用Apple Mac(OS X), CentOS, Ubuntu, Red Hat, Fedora, FreeBSD等类Unix操作系统来启动MeepoPS.\n- Windows用户可以安装VirtualBox, Vmware等虚拟机软件来运行MeepoPS.\n- MeepoPS需要PHP的POSIX库. POSIX是PHP默认安装的, 通常情况下你不需要手动安装. 如何安装: [PHP手册-POSIX安装](http://php.net/manual/zh/posix.installation.php)\n- 多进程及信号处理需要依赖PHP的PCNTL库. MeepoPS深度依赖PCNTL, 因此PCNTL库是必须安装的, 即使只启动一个进程的MeepoPS, 仍然需要安装PCNTL. 如何安装: [PHP手册-PCNTL安装](http://php.net/manual/zh/pcntl.installation.php)\n- 在大规模访问下, 我们建议安装PHP的PECL扩展Libevent, 但这不是必须的. 在高链接数的场景下, Libevent表现优异. 如何安装: [PHP手册-Libevent安装](http://php.net/manual/zh/libevent.installation.php). 截止2016-05-06, PHP官方的Libevent扩展不支持PHP7, PHP7下的Libevent安装方法: [PHP7的Libevent分支](https://github.com/expressif/pecl-event-libevent)\n- 默认监听链接的方式为Select轮询机制. PHP的Select轮询机制最多只能监听1024个链接. 想要突破这个限制, 要么安装Libevent, 要么使用--enable-fd-setsize=2048重新编译安装PHP.\n\n#### 快速入门:\n\n##### 服务端使用方法:\n基础功能和用法都写在demo-telnet.php, 基本您就可以直接用. \n\n###### 普通终端启动:\n    1. 启动: 命令行输入\"php demo-telnet.php start\".\n    2. 状态: 命令行输入\"php demo-telnet.php status\".\n    3. 平滑结束: 启动后按下\"ctrl + c\"即可.\n    4. 强行结束: 命令行输入\"kill -INT `cat /var/run/meepops/meepops_master.pid`\".\n\n###### 守护进程模式启动:\n    1. 启动: 命令行输入\"php demo-telnet.php start -d\".\n    2. 状态: 命令行输入\"php demo-telnet.php status\".\n    3. 平滑结束: 命令行输入\"php demo-telnet.php stop\".\n    4. 强行结束: 命令行输入\"php demo-telnet.php kill\".\n    5. 强行结束: 命令行输入\"kill -INT `cat /var/run/meepops/meepops_master.pid`\".\n\n###### DEMO:\n    1. 基于Telnet协议的服务端使用方法请参考demo-telnet.php.\n    2. 如果服务端启动的是HOST是0.0.0.0, 那么客户端可以是外机,可以是本机.本机可以是127.0.0.1, 也可以是localhost.\n    3. 如果服务端启动的是HOST是127.0.0.1/localhost, 那么客户端是不能外机,只能是本机.\n\n##### 客户端使用方法:\n\n###### Telnet:\n    客户端可使用telnet客户端.如: telnet 127.0.0.1 19910\n\n###### 编写代码:\n    客户端可借助编程语言的Socket来实现. 可参考Test/test_client.php\n\n##### 惊鸿一瞥:\n  1. MeepoPS/config.ini是MeepoPS的配置文件. 采用和php.ini同样的格式, \";\"为注释.\n  2. 必须引入MeepoPS/index.php文件. 使用MeepoPS都是从 require_once 'MeepoPS/index.php' 开始的.\n  3. MeepoPS/Api/目录下的文件为暴露给用户的接口. 需要实例化接口类文件, MeepoPS的使用都是围绕实例化接口文件后的对象来操作的. 实例化的时候传入监听的HOST和端口即可.\n  4. MeepoPS会以回调函数的方式来触发您设置的业务逻辑. 比如新链接加入时会回调您设置的\"Hello world\", 再比如某个链接发送了消息\"PING\"时, 会回调您设置的返回消息\"PONG\".\n  5. MeepoPS可以启动多个实例, 每一次的new接口类文件都是一次实例化.\n  7. MeepoPS不但可以实例化多个接口类文件, 也可以实例化同一个接口类文件多次. 比如启动了三个实例, 分别监听了19910, 19911, 19912端口.\n  6. 实例化接口类文件并进行了相关设置后, 调用\\MeepoPS\\runMeepoPS()即可启动MeepoPS.\n  7. \\MeepoPS\\runMeepoPS()之后的所有代码都将不会执行.\n\n#### 示例:\nExample目录下是示例案例, 每一个目录是一个独立的项目. 会不断添加.\n\n#### 测试案例:\n[请看文档-测试一栏](http://meepops.lanecn.com/doc/main/8-test/1-event-and-child-proccess.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixuancn%2FMeepoPS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flixuancn%2FMeepoPS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixuancn%2FMeepoPS/lists"}