
Swoole
思维小刀
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Swoole Interview
Swoole执行流程初始化创建Manager管理进程,创建Worker工作子进程,监听所有TCP/UDP端口,监听定时器Timer。onStartonStart回调函数是在Master主进程中执行的,和Worker工作子进程的onWorkStart是并行的,并没有先后之分。在此回调函数中强烈要求只做Log记录和进程名设置操作,不要做业务逻辑。因为业务逻辑代码的错误将直接导致Master主进程Crash崩溃,进而让整个Swoole服务器无法对外提供服务。onReceive客户端请求的数据到原创 2021-05-12 17:10:11 · 139 阅读 · 0 评论 -
Swoole的全双工、半双工和单工
1、单工单工就是指A只能发信号,而B只能接收信号,通信是单向的,就象灯塔之于航船——灯塔发出光信号而航船只能接收信号以确保自己行驶在正确的航线上。2、半双工半双工就是指A能发信号给B,B也能发信号给A,但这两个过程不能同时进行。最典型的例子就象我们在影视作品中看到的对讲机一样:湖盟防御帮助中心007:呼叫总部,请求支援,OVER总部:收到,增援人员将在5分钟内赶到,OVER007...原创 2020-04-21 18:48:02 · 311 阅读 · 0 评论 -
Swoole的TCP/IP HTTP WebSocket关系
dddd原创 2020-04-03 09:41:24 · 977 阅读 · 0 评论 -
Swoole之I/O操作
说明在计算机科学中指计算机之间或人与计算机之间的信息交换。比如两台计算机通过网卡进行交互,比如向硬盘写入数据或读取硬盘数据,比如人敲击鼠标键盘等,都是I/O。具体的参见上面的详细说明。你这里的I/O一般指进程通过网络或存储介质读取或写入数据。以写数据为例,如果是阻塞型写入操作,进程要一直等待写结束返回 自己才会进行后面的操作,但是如果你使用异步I/O,你可以将写请求发送到队列,...原创 2020-04-14 12:38:04 · 219 阅读 · 0 评论 -
Swoole同步/异步/阻塞/非阻塞的理解
https://blog.youkuaiyun.com/qq_32725491/article/details/78679414原创 2020-04-14 12:34:30 · 1245 阅读 · 0 评论 -
Swoole安装make报错 因为php-config配错
报错NOTICE: PHP message: PHP Warning: PHP Startup: swoole: Unable to initialize moduleModule compiled with module API=20090626PHP compiled with module API=20121212These options need to matchin U...原创 2020-04-12 17:25:38 · 1039 阅读 · 0 评论 -
Swoole安装报错No releases available for package "pecl.php.net/swoole"
报错No releases available for package "pecl.php.net/swoole"install failed方法解决方法是只需使用root权限即可:sudo pecl search swoole原创 2020-04-12 12:42:12 · 3215 阅读 · 0 评论 -
Swoole实现私聊群聊
https://www.jianshu.com/p/764a218197da原创 2020-06-01 09:50:53 · 705 阅读 · 0 评论 -
Swoole跨域问题解决
1.前端跨域:使用jsonp2.后端跨域:设置allow-originheader('access-Control-Allow-Origin:*');原创 2020-04-10 15:35:21 · 1973 阅读 · 0 评论 -
Swoole报错Failed to execute ‘send’ on ‘WebSocket’: Still in CONNECTING state. a
原来//实例对象的onopen属性websocket.onopen = function (evt) { websocket.send("send message"); console.log("connected");}修改bug//实例对象的onopen属性websocket.onopen = function (evt) { if (websoc...原创 2020-04-10 12:03:31 · 1208 阅读 · 0 评论 -
Swoole的think-swoole的安装
tp框架5.1.*对应着think/swoole的2.* tp框架6.*对应着think/swoole的3.* 运行composer会出现这个Do not run Composer as root/super user! See https://getcomposer.org/root for details不影响使用的 慢慢等就可以了!...原创 2020-03-24 22:00:43 · 1044 阅读 · 0 评论 -
Swoole异步发送邮件
qqqqqq原创 2020-03-22 12:04:54 · 215 阅读 · 0 评论 -
Swoole使用TP5.1框架
参考1https://blog.youkuaiyun.com/IT_10/article/details/90900017参考2https://blog.youkuaiyun.com/qq_16059847/article/details/83145113?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_...原创 2020-02-23 19:10:23 · 601 阅读 · 0 评论 -
Swoole报can't be executed without task worker
[root@192 example]# php wsclass.phpserver: handshake success with fd1receive from 1:send message,opcode:1,fin:1PHP Warning: Swoole\Server::task(): task method can't be executed without task worke...原创 2020-02-08 12:32:37 · 1758 阅读 · 1 评论 -
Swoole命令行输出但浏览器会超时
<?php$http = new swoole_http_server("0.0.0.0", 8811);print_r("a");$http->set([ 'enable_static_handler' => true, 'document_root' => "/home/wwwroot/l2.l2.l2/static",//设置根目录这里根据你...原创 2020-02-08 00:24:18 · 840 阅读 · 0 评论 -
Swoole找不到telnet命令
[root@localhost ~]# telnet 127.0.0.1-bash: telnet: command not foundyum list telnet* 列出telnet相关的安装包yum install telnet-server 安装telnet服务yum install telnet.* 安装tel...原创 2020-02-04 17:29:05 · 265 阅读 · 0 评论 -
Swoole安装步骤
参考:https://www.jianshu.com/p/fa2cbf1a9e261.更新源yum update2.安装pecl(默认安装 php7.2 没有pecl,如果已经安装可忽略)yum install php72w-develyum install php72w-pear3.安装 swoolepecl install swoole3.1补充: ...原创 2020-02-04 12:29:54 · 824 阅读 · 0 评论 -
Swoole安装popen()找不到
报错[root@192 swoole]# pecl install swooleWARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to updateWarning: popen() has been disabled for security...原创 2020-02-04 12:07:40 · 568 阅读 · 0 评论