# 4.2.13
[TOC]
## 修复(需注意的不兼容变更)
* 修复Redis订阅模式API设计问题导致重复订阅和订阅消息丢失的问题 (详见:[订阅模式文档](https://wiki.swoole.com/wiki/page/1041.html)或 附录示例代码) ([#2305](https://github.com/swoole/swoole-src/pull/2305)) (@windrunner414)
* 使用协程化时, 不能再`pconnect`等传统连接复用的方法, 否则会产生多协程同时复用同一个Socket的问题 ([7b1e786](https://github.com/swoole/swoole-src/commit/7b1e78643c40b0c8ace1bca8c7b10e3064cce488)) (@shiguangqi)
## 增强
* 协程客户端支持全双工 ([#2350](https://github.com/swoole/swoole-src/pull/2350)) (@twosee)
* 支持安全的跨协程close ([#2327](https://github.com/swoole/swoole-src/pull/2327)) (@twosee)
* [RFC-1015](https://github.com/swoole/rfc-chinese/issues/38): 非Worker进程允许单向投递任务 ([222043a](https://github.com/swoole/swoole-src/commit/222043a235b7a4eb62b7d14f1ab38844c7bdd510)) (@matyhtf)
* `swoole_strerror`支持自动转换系统错误码和Swoole底层错误码为文字, 无需指定参数 ([c92f444](https://github.com/swoole/swoole-src/commit/c92f44460b1762a3165ac3d8e2733b5a6db19092)) (@twosee)
* gdb追踪工具支持查看定时器和reactor信息 ([2beb563](https://github.com/swoole/swoole-src/commit/2beb563abe3f2dec8b7a9f0327fb63f0bc946e14)) (@shiguangqi)
* 使用Redis集群时出现MOVED和ASK错误时将自动转移到对应服务端 ([#2299](https://github.com/swoole/swoole-src/pull/2299)) (@windrunner414)
* 底层代码优化, 减少收包时的内存拷贝 (@matyhtf)
* 现在调用`Co\Socket->close()`将会立即close fd, 而非等待对象析构后close, close后调用其它任何API将返回BADF错误 (和系统API保持一致) ([7a61963](https://github.com/swoole/swoole-src/commit/7a6196359686d749b7e045908414f82b105dbbdc)) (@twosee)
* 一些非法的参数不再会导致致命错误而是产生一个警告, 因为外部传参有时不可控, 存在一定风险 ([cd432d3](https://github.com/swoole/swoole-src/commit/cd432d31c3e358fcdb297390967a3187b35433f9)) (@twosee)
* 使用协程化后API兼容性增强(和同步阻塞表现一致) ([36687e8](https://github.com/swoole/swoole-src/commit/36687e8081a36060f56ceca4272fb6358c092529)) (@matyhtf)
* 现在swoole\\src可以同时作为C\\C++库使用(libswoole)
## 修复
* 修复初次加载前存在大量对象时可能的coredump问题 ([4ddeedb](https://github.com/swoole/swoole-src/commit/4ddeedbb06351b03dc94c495eaae60b8a007e65e)) (@twosee)
* 修复没有DNS缓存时尝试清除缓存导致的coredump ([#2288](https://github.com/swoole/swoole-src/pull/2288)) (@mabu233)
* 启用`task_enable_coroutine`后, 错误地调用`Server->finish`会触发致命错误 ([156ede6](https://github.com/swoole/swoole-src/commit/156ede623b7fff6ec1aa9c290bd5cae8fca1d51a)) (@twosee)
* 现在php.ini配置指定`On`和`Off`时能正确显示(而不是显示0) ([fe25982](https://github.com/swoole/swoole-src/commit/fe259822fc316adbb576a116f75137cc934d6b13)) (@twosee)
* 修复`Co::getaddrinfo`后几个参数接收错误的BUG ([#2273](https://github.com/swoole/swoole-src/pull/2273)) (@mabu233)
* 修复dispatch\_func在UDP模式下时fd错误的问题 ([#2306](https://github.com/swoole/swoole-src/pull/2306)) (@mabu233)
* 修复dispatch\_func在指定函数名时不生效的BUG, 回调在未接收包体数据参数时减少内存拷贝(如基于fd分配的模式) ([2bc49e4](https://github.com/swoole/swoole-src/commit/2bc49e4dc16d408f7cc5043c09d7435802abbdcf)) (@twosee)
* Task过期时将不再触发PHP警告(而是swoole底层的日志警告) ([54eee5e](https://github.com/swoole/swoole-src/commit/54eee5e128daf85d72b1cb2d59e0d9c08827653b)) (@matyhtf)
* 修复进程重启时enable\_coroutine失效问题 ([#2310](https://github.com/swoole/swoole-src/pull/2310))
* 修复进程id属性不正确的问题 ([#2313](https://github.com/swoole/swoole-src/pull/2313)) (@junwei-qu)
* 修复BASE模式下错误地在onStart回调中使用异步API导致的问题 ([#2308](https://github.com/swoole/swoole-src/issues/2308)) (@matyhtf)
* 修复BASE模式下manager\_id不正确 ([e18e013](https://github.com/swoole/swoole-src/commit/e18e013cac20d3d4e332360ddcc7ba5ffb035346)) (@matyhtf )
* 修复mmap使用SEEK\_END偏移错误 ([#2314](https://github.com/swoole/swoole-src/pull/2314)) (@junwei-qu)
* 修复getSocket内存泄漏 ([ec8c4b2](https://github.com/swoole/swoole-src/commit/ec8c4b2be95aa27d0984bd85460c40da7a088e34)) (@twosee)
* 优化stream模式 ([47e0e9e](https://github.com/swoole/swoole-src/commit/47e0e9ec7e56c7c664a1d04acb0f8fbe40710e98)) (@matyhtf )
* 修复同步客户端KEEP模式下连接复用在某些情况下导致的BUG ([4c5728b](https://github.com/swoole/swoole-src/commit/4c5728b5b552de09d9bf6bd323fb62473071a4a5)) (@matyhtf)
* 修复MacOS下`Atmoic`多次`wait`和`wakeup`溢出的问题 ([fbccb25](https://github.com/swoole/swoole-src/commit/fbccb252707812f1791280bcaaa2048b7e8f601a)) (@twosee)
* 修复开启static\_handler存在目录遍历攻击风险的问题, 这是一个便利性调试功能, 请勿用于生产 ([#2323](https://github.com/swoole/swoole-src/pull/2323)) (@windrunner414)
* 修复未检查futex\_wait系统调用的返回值 ([#2351](https://github.com/swoole/swoole-src/pull/2351)) (@junwei-qu)
* 修复Reids::ZAdd API解析参数的BUG, 并修复其它潜在的类型转换问题 ([#2321](https://github.com/swoole/swoole-src/issues/2321)) ([21e0497](https://github.com/swoole/swoole-src/commit/21e04977659ca48e69f65bda097683eaef98f36e)) ([a0e612f](https://github.com/swoole/swoole-src/commit/a0e612f4308fb8702d84a38d8d8a4921b096a733)) ([00134cf](https://github.com/swoole/swoole-src/commit/00134cfa7d730c10edc623abae4866cfec2acc23)) ([f5a331e](https://github.com/swoole/swoole-src/commit/f5a331e011f378ef36ab3f7e47af12b35e53e374)) ([5f87f17](https://github.com/swoole/swoole-src/commit/5f87f178ccc1f9dbab65745618cd22351e896574)) ([a15f094](https://github.com/swoole/swoole-src/commit/a15f094e42eba6df67e0b7678648c261f6e05c7c)) ([67f3285](https://github.com/swoole/swoole-src/commit/67f328541e5a0cb17e532038c7a35b4666e42b1b)) ([808f578](https://github.com/swoole/swoole-src/commit/808f57826160578223e5e90ba4d370930410b6a9)) ([d118fe3](https://github.com/swoole/swoole-src/commit/d118fe3f9e5b3b15877bb49eacccc38bd4b992d8)) ([5294473](https://github.com/swoole/swoole-src/commit/52944739f61e36cb49a2828ec699da3bfb5d7c63)) ([48f6790](https://github.com/swoole/swoole-src/commit/48f6790deeaa5b2e6fae90ada1ca6d87a99c410e)) ([0105c7f](https://github.com/swoole/swoole-src/commit/0105c7f6c24551434e4e7542c4b6fb1b3ca31959)) ([ba6c8b4](https://github.com/swoole/swoole-src/commit/ba6c8b4c25c27a62a3ad8dc035d19d6012ee0e64)) (@matyhtf)
* 修复发送数据时没有使用函数指针可能导致的第三方hook失败 ([89ba2da](https://github.com/swoole/swoole-src/commit/89ba2dafe75b83ca8e459345c719f8e83aa53480)) (@matyhtf )
* 兼容性: Mysql escape方法出错时将返回空字符串而不是FALSE
* 修复Timer::tick方法有传参时产生的内存泄露 ([7e15141](https://github.com/swoole/swoole-src/commit/7e15141177b84c9a18030f1f8b7fcdcd9a29a83c)) (@mabu233)
* 修复自定义进程不能自动退出 ([2901ce0](https://github.com/swoole/swoole-src/commit/2901ce0a975486e1b656906858a0b7d2f1c52603)) (@matyhtf)
* 修复协程化后连接超时时间影响到读操作超时时间 ([a990540](https://github.com/swoole/swoole-src/commit/a9905408989dcee4b31a3d5b6ca68c9ecde855e6)) (@shiguangqi)
* 修复`Co\Client`指定收包规则后, 传参超时时间不生效的问题 ([#2346](https://github.com/swoole/swoole-src/issues/2346)) (@twosee)
* Server在BASE模式下不再受`buffer_output_size`限制, 仅受`socket_buffer_size`限制 ([#2326](https://github.com/swoole/swoole-src/issues/2326)) (@matyhtf)
* 修复在FREEBSD下的编译错误 ([#2325](https://github.com/swoole/swoole-src/issues/2325)) (@matyhtf)
## 单元测试
* 更多的单元测试
* 新增内存测试到valgrind分支, 分离alpine测试到alpine分支, 自动触发测试
* 测试支持在任意装有docker的主机上运行并自动部署基于docker的swoole/mysql/redis容器, 详情参阅源码目录下travis文件夹内的README文档
## 其它
* Swoole\\Serialize现已支持在PHP73下正常运作, 但仍标记为待废除的功能, 不建议使用
## 附录
### 协程Redis订阅模式示例代码:
~~~
$redis = new Swoole\Coroutine\Redis();
$redis->connect('127.0.0.1', 6379);
if ($redis->subscribe(['channel1', 'channel2', 'channel3'])) // 或者使用psubscribe
{
while ($msg = $redis->recv()) {
// msg是一个数组, 包含以下信息
// $type # 返回值的类型:显示订阅成功
// $name # 订阅的频道名字 或 来源频道名字
// $info # 目前已订阅的频道数量 或 信息内容
list($type, $name, $info) = $msg;
if ($type == 'subscribe') // 或psubscribe
{
// 频道订阅成功消息,订阅几个频道就有几条
}
else if ($type == 'unsubscribe' && $info == 0) // 或punsubscribe
{
break; // 收到取消订阅消息,并且剩余订阅的频道数为0,不再接收,结束循环
}
else if ($type == 'message') // 若为psubscribe,此处为pmessage
{
// 打印来源频道名字
var_dump($name);
// 打印消息
var_dump($info);
// 处理消息
if ($need_unsubscribe) // 某个情况下需要退订
{
$redis->unsubscribe(); // 继续recv等待退订完成
}
}
}
}
~~~
- 序言
- 入门指引
- 环境依赖
- 编译安装
- 编译参数
- 常见错误
- Cygwin
- Linux二进制包
- 快速起步
- 创建TCP服务器
- 创建UDP服务器
- 创建Web服务器
- 创建WebSocket服务器
- 设置定时器
- 执行异步任务
- 创建同步TCP客户端
- 创建异步TCP客户端
- 网络通信协议设计
- 使用异步客户端
- 多进程共享数据
- 使用协程客户端
- 协程:并发 shell_exec
- 协程:Go + Chan + Defer
- 协程:实现 Go 语言风格的 defer
- 协程:实现 sync.WaitGroup 功能
- 编程须知
- sleep/usleep的影响
- exit/die函数的影响
- while循环的影响
- stat缓存清理
- mt_rand随机数
- 进程隔离
- 版本更新记录
- 4.3.1
- 4.3.0 [大版本]
- 4.2.13
- 4.2.12
- 4.2.11
- 4.2.10
- 4.2.9
- 4.2.8
- 4.2.7
- 4.2.0
- 4.1.0
- 4.0.1
- 4.0.0
- 向下不兼容改动
- 新特性使用
- 4.3.0 在 Process 中使用协程
- 4.3.0 延时事件机制改进
- 2.1.2 进程池模块的使用
- 1.9.24 调度支持 Stream 模式
- 1.9.24 异步客户端自动解析域名
- 1.9.17 支持异步安全重启特性
- 1.9.14 使用异步客户端超时机制
- 1.8.0 使用内置Http异步客户端
- 1.7.16 使用迭代器遍历Server所有连接
- 1.7.5 在Server中使用swoole_table
- 1.7.5 swoole_client支持sendfile接口
- 1.7.4 SSL隧道加密TCP-Server
- 1.7.4 task进程中使用毫秒定时器
- 1.7.3 固定包头+包体协议自动分包
- 1.7.3 onTask直接return取代finish函数
- 1.7.2 swoole_process多进程模块的使用
- 1.7.2 task进程使用消息队列
- 项目路线图
- php.ini选项
- 内核参数调整
- 开发者列表
- 衍生开源项目
- 框架
- 工具
- 分布式
- 通信协议
- 用户与案例
- 物联网项目
- 网络游戏
- 腾讯(Tencent)
- 百度(Baidu.com)
- 阅文集团
- BiliBili(哔哩哔哩)
- 车轮互联(chelun.com)
- (捞月狗) 游戏社区
- 儒博(roobo.com)
- 提交错误报告
- 常见问题
- 升级swoole版本的常见问题
- 生成可分发的二进制swoole版本
- 在phpinfo中有在php -m中没有
- Connection refused是怎么回事
- Resource temporarily unavailable [11]
- Cannot assign requested address [99]
- swoole与node.js相比有哪些优势
- swoole与golang相比有哪些优势
- pcre.h: No such file or directory
- undefined symbol: __sync_bool_compare_and_swap_4
- 学习Swoole需要掌握哪些基础知识
- 同步阻塞与异步非阻塞适用场景
- PHP7环境下出现zend_mm_heap corrupted
- Swoole 项目起源和名字由来
- '__builtin_saddl_overflow' was not declared in this scope
- Server
- 函数列表
- Server::__construct
- Server->set
- Server->on
- Server->addListener
- Server->addProcess
- Server->listen
- Server->start
- Server->reload
- Server->stop
- Server->shutdown
- Server->tick
- Server->after
- Server->defer
- Server->clearTimer
- Server->close
- Server->send
- Server->sendfile
- Server->sendto
- Server->sendwait
- Server->sendMessage
- Server->exist
- Server->pause
- Server->resume
- Server->getClientInfo
- Server->getClientList
- Server->bind
- Server->stats
- Server->task
- Server->taskwait
- Server->taskWaitMulti
- Server->taskCo
- Server->finish
- Server->heartbeat
- Server->getLastError
- Server->getSocket
- Server->protect
- Server->confirm
- 属性列表
- Server::$setting
- Server::$master_pid
- Server::$manager_pid
- Server::$worker_id
- Server::$worker_pid
- Server::$taskworker
- Server::$connections
- Server::$ports
- 配置选项
- reactor_num
- worker_num
- max_request
- max_conn (max_connection)
- task_worker_num
- task_ipc_mode
- task_max_request
- task_tmpdir
- dispatch_mode
- dispatch_func
- message_queue_key
- daemonize
- backlog
- log_file
- log_level
- heartbeat_check_interval
- heartbeat_idle_time
- open_eof_check
- open_eof_split
- package_eof
- open_length_check
- package_length_type
- package_length_func
- package_max_length
- open_cpu_affinity
- cpu_affinity_ignore
- open_tcp_nodelay
- tcp_defer_accept
- ssl_cert_file
- ssl_method
- ssl_ciphers
- user
- group
- chroot
- pid_file
- pipe_buffer_size
- buffer_output_size
- socket_buffer_size
- enable_unsafe_event
- discard_timeout_request
- enable_reuse_port
- enable_delay_receive
- open_http_protocol
- open_http2_protocol
- open_websocket_protocol
- open_mqtt_protocol
- open_websocket_close_frame
- reload_async
- tcp_fastopen
- request_slowlog_file
- enable_coroutine
- max_coroutine
- task_enable_coroutine
- ssl_verify_peer
- 监听端口
- 可选参数
- 可选回调
- 连接迭代器
- 预定义常量
- 事件回调函数
- onStart
- onShutdown
- onWorkerStart
- onWorkerStop
- onWorkerExit
- onConnect
- onReceive
- onPacket
- onClose
- onBufferFull
- onBufferEmpty
- onTask
- onFinish
- onPipeMessage
- onWorkerError
- onManagerStart
- onManagerStop
- 高级特性
- 改变Worker进程的用户/组
- 回调函数中的 reactor_id 和 fd
- Length_Check 和 EOF_Check 的使用
- Worker与Reactor通信模式
- TCP-Keepalive死连接检测
- TCP服务器心跳维持方案
- 多端口监听的使用
- 捕获Server运行期致命错误
- Server内存管理机制
- Server的两种运行模式介绍
- Server中对象的4层生命周期
- 在worker进程内监听一个Server端口
- 在php-fpm/apache中使用task功能
- 常见问题
- 为什么不要send完后立即close
- 如何在回调函数中访问外部的变量
- 是否可以共用1个redis或mysql连接
- 关于onConnect/onReceive/onClose顺序
- 4种PHP回调函数风格
- 不同的Server程序实例间如何通信
- 错误信息:ERROR (9006)
- eventLoop has already been created. unable to create swoole_server
- 压力测试
- 并发10万TCP连接的测试
- PHP7+Swoole/Nginx/Golang性能对比
- 全球Web框架权威性能测试 Techempower Web Framework Benchmarks
- Coroutine
- Coroutine
- Coroutine::set
- Coroutine::stats
- Coroutine::create
- Coroutine::exist
- Coroutine::getCid
- Coroutine::getPcid
- Coroutine::getContext
- Coroutine::defer
- Coroutine::list
- Coroutine::getBackTrace
- Coroutine::yield
- Coroutine::resume
- Coroutine::fread
- Coroutine::fgets
- Coroutine::fwrite
- Coroutine::sleep
- Coroutine::gethostbyname
- Coroutine::getaddrinfo
- Coroutine::exec
- Coroutine::readFile
- Coroutine::writeFile
- Coroutine::statvfs
- Coroutine\Channel
- Coroutine\Channel->__construct
- Coroutine\Channel->push
- Coroutine\Channel->pop
- Coroutine\Channel->stats
- Coroutine\Channel->close
- Coroutine\Channel->length
- Coroutine\Channel->isEmpty
- Coroutine\Channel->isFull
- Coroutine\Channel->$capacity
- Coroutine\Channel->$errCode
- Coroutine\Client
- Coroutine\Client->connect
- Coroutine\Client->send
- Coroutine\Client->recv
- Coroutine\Client->close
- Coroutine\Client->peek
- Coroutine\Http\Client
- 属性列表
- Coroutine\Http\Client->get
- Coroutine\Http\Client->post
- Coroutine\Http\Client->upgrade
- Coroutine\Http\Client->push
- Coroutine\Http\Client->recv
- Coroutine\Http\Client->addFile
- Coroutine\Http\Client->addData
- Coroutine\Http\Client->download
- Coroutine\Http2\Client
- Coroutine\Http2\Client->__construct
- Coroutine\Http2\Client->set
- Coroutine\Http2\Client->connect
- Coroutine\Http2\Client->send
- Coroutine\Http2\Client->write
- Coroutine\Http2\Client->recv
- Coroutine\Http2\Client->close
- Coroutine\Redis
- Coroutine\Redis::__construct
- Coroutine\Redis::setOptions
- 属性列表
- 事务模式
- 订阅模式
- Coroutine\Socket
- Coroutine\Socket::__construct
- Coroutine\Socket->bind
- Coroutine\Socket->listen
- Coroutine\Socket->accept
- Coroutine\Socket->connect
- Coroutine\Socket->send
- Coroutine\Socket->sendAll
- Coroutine\Socket->recv
- Coroutine\Socket->recvAll
- Coroutine\Socket->sendto
- Coroutine\Socket->recvfrom
- Coroutine\Socket->getsockname
- Coroutine\Socket->getpeername
- Coroutine\Socket->close
- Coroutine\MySQL
- 属性列表
- Coroutine\MySQL->connect
- Coroutine\MySQL->query
- Coroutine\MySQL->prepare
- Coroutine\MySQL->escape
- Coroutine\MySQL->begin
- Coroutine\MySQL->commit
- Coroutine\MySQL->rollback
- Coroutine\MySQL\Statement->execute
- Coroutine\MySQL\Statement->fetch
- Coroutine\MySQL\Statement->fetchAll
- Coroutine\MySQL\Statement->nextResult
- Coroutine\PostgreSQL
- Coroutine\PostgreSQL->connect
- Coroutine\PostgreSQL->query
- Coroutine\PostgreSQL->fetchAll
- Coroutine\PostgreSQL->affectedRows
- Coroutine\PostgreSQL->numRows
- Coroutine\PostgreSQL->fetchObject
- Coroutine\PostgreSQL->fetchAssoc
- Coroutine\PostgreSQL->fetchArray
- Coroutine\PostgreSQL->fetchRow
- Coroutine\PostgreSQL->metaData
- Coroutine\PostgreSQL->prepare
- Server
- 并发调用
- setDefer 机制
- 子协程+通道
- 实现原理
- 协程与线程
- 发送数据协程调度
- 协程内存开销
- 4.0 协程实现原理
- 协程客户端超时规则
- 协程执行流程
- 常见问题
- 运行中出现 Fatal error: Maximum function nesting level of '1000' reached, aborting!
- 为什么只能在回调函数中使用协程客户端
- 支持协程的回调方法列表
- 错误信息: XXXX client has already been bound to another coroutine
- Swoole4 协程与 PHP 的 Yield/Generator 协程有什么区别
- Swoole4 协程与 Go 协程有哪些区别
- 编程须知
- 在多个协程间共用同一个协程客户端
- 禁止使用协程 API 的场景(2.x 版本)
- 使用类静态变量/全局变量保存上下文
- 退出协程
- 异常处理
- 扩展组件
- MongoDB
- 编程调试
- Runtime
- 文件操作
- 睡眠函数
- 开关选项
- 严格模式
- Timer
- swoole_timer_tick
- swoole_timer_after
- swoole_timer_clear
- Memory
- Lock
- swoole_lock->__construct
- swoole_lock->lock
- swoole_lock->trylock
- swoole_lock->unlock
- swoole_lock->lock_read
- swoole_lock->trylock_read
- swoole_lock->lockwait
- Buffer
- swoole_buffer->__construct
- swoole_buffer->append
- swoole_buffer->substr
- swoole_buffer->clear
- swoole_buffer->expand
- swoole_buffer->write
- swoole_buffer->read
- swoole_buffer->recycle
- Table
- Table->__construct
- Table->column
- Table->create
- Table->set
- Table->incr
- Table->decr
- Table->get
- Table->exist
- Table->count
- Table->del
- Atomic
- swoole_atomic->__construct
- swoole_atomic->add
- swoole_atomic->sub
- swoole_atomic->get
- swoole_atomic->set
- swoole_atomic->cmpset
- swoole_atomic->wait
- swoole_atomic->wakeup
- mmap
- swoole_mmap::open
- Channel
- Channel->__construct
- Channel->push
- Channel->pop
- Channel->stats
- Serialize
- swoole_serialize::pack
- swoole_serialize::unpack
- Http\Server
- Http\Server
- Http\Server->on
- Http\Server->start
- Http\Request
- Http\Request->$header
- Http\Request->$server
- Http\Request->$get
- Http\Request->$post
- Http\Request->$cookie
- Http\Request->$files
- Http\Request->rawContent
- Http\Request->getData
- Http\Response
- Http\Response->header
- Http\Response->cookie
- Http\Response->status
- Http\Response->gzip
- Http\Response->redirect
- Http\Response->write
- Http\Response->sendfile
- Http\Response->end
- Http\Response->detach
- Http\Response::create
- 配置选项
- upload_tmp_dir
- http_parse_post
- document_root
- http_compression
- 常见问题
- CURL发送POST请求服务器端超时
- 使用Chrome访问服务器会产生2次请求
- GET/POST请求的最大尺寸
- WebSocket\Server
- 回调函数
- onHandShake
- onOpen
- onMessage
- 函数列表
- WebSocket\Server->push
- WebSocket\Server->exist
- WebSocket\Server::pack
- WebSocket\Server::unpack
- WebSocket\Server->disconnect
- WebSocket\Server->isEstablished
- 预定义常量
- 常见问题
- 配置选项
- WebSocket\Frame
- Redis\Server
- 方法
- Redis\Server->setHandler
- Redis\Server::format
- 常量
- Process
- Process::__construct
- Process->start
- Process->name
- Process->exec
- Process->write
- Process->read
- Process->setTimeout
- Process->setBlocking
- Process->useQueue
- Process->statQueue
- Process->freeQueue
- Process->push
- Process->pop
- Process->close
- Process->exit
- Process::kill
- Process::wait
- Process::daemon
- Process::signal
- Process::alarm
- Process::setAffinity
- Process::exportSocket
- Process\Pool
- Process\Pool::__construct
- Process\Pool->on
- Process\Pool->listen
- Process\Pool->write
- Process\Pool->start
- Process\Pool->getProcess
- Client
- 方法列表
- swoole_client::__construct
- swoole_client->set
- swoole_client->on
- swoole_client->connect
- swoole_client->isConnected
- swoole_client->getSocket
- swoole_client->getSockName
- swoole_client->getPeerName
- swoole_client->getPeerCert
- swoole_client->send
- swoole_client->sendto
- swoole_client->sendfile
- swoole_client->recv
- swoole_client->close
- swoole_client->sleep
- swoole_client->wakeup
- swoole_client->enableSSL
- 回调函数
- onConnect
- onError
- onReceive
- onClose
- onBufferFull
- onBufferEmpty
- 属性列表
- swoole_client->errCode
- swoole_client->sock
- swoole_client->reuse
- 并行
- swoole_client_select
- TCP客户端异步连接
- SWOOLE_KEEP建立TCP长连接
- 常量
- 配置选项
- ssl_verify_peer
- ssl_host_name
- ssl_cafile
- ssl_capath
- package_length_func
- http_proxy_host
- 常见问题
- Event
- swoole_event_add
- swoole_event_set
- swoole_event_isset
- swoole_event_write
- swoole_event_del
- swoole_event_exit
- swoole_event_defer
- swoole_event_cycle
- swoole_event_wait
- swoole_event_dispatch
- 常见问题
- epoll_wait 偶尔会用很长时间
- 异步回调
- 异步文件系统IO
- swoole_async_readfile
- swoole_async_writefile
- swoole_async_read
- swoole_async_write
- swoole_async_dns_lookup
- swoole_async::exec
- 异步MySQL客户端
- swoole_mysql->__construct
- swoole_mysql->on
- swoole_mysql->connect
- swoole_mysql->escape
- swoole_mysql->query
- swoole_mysql->begin
- swoole_mysql->commit
- swoole_mysql->rollback
- swoole_mysql->close
- 异步Redis客户端
- swoole_redis->__construct
- swoole_redis->on
- swoole_redis->connect
- swoole_redis->__call
- swoole_redis->close
- 异步Http/WebSocket客户端
- swoole_http_client->__construct
- swoole_http_client->set
- swoole_http_client->setMethod
- swoole_http_client->setHeaders
- swoole_http_client->setCookies
- swoole_http_client->setData
- swoole_http_client->addFile
- swoole_http_client->get
- swoole_http_client->post
- swoole_http_client->upgrade
- swoole_http_client->push
- swoole_http_client->execute
- swoole_http_client->download
- swoole_http_client->close
- 异步Http2.0客户端
- swoole_http2_client->__construct
- swoole_http2_client->get
- swoole_http2_client->post
- swoole_http2_client->setHeaders
- swoole_http2_client->setCookies
- 高级
- Swoole的实现
- Reactor线程
- Manager进程
- Worker进程
- Reactor、Worker、TaskWorker的关系
- Task/Finish特性的用途
- 在php-fpm或apache中使用swoole
- Swoole异步与同步的选择
- TCP/UDP压测工具
- swoole服务器如何做到无人值守100%可用
- MySQL的连接池、异步、断线重连
- PHP中哪些函数是同步阻塞的
- 守护进程程序常用数据结构
- 队列(Queue)
- 堆(Heap)
- 定长数组(SplFixedArray)
- 使用jemalloc优化swoole内存分配性能
- C开发者如何使用Swoole
- C++开发者如何使用Swoole
- 使用systemd管理swoole服务
- 网卡中断设置
- 将Swoole静态编译内嵌到PHP
- 异步回调程序内存管理
- 日志等级控制
- 使用 asan 内存检测
- Windows编译
- Swoole协程之旅-前篇
- Swoole协程之旅-中篇
- Swoole协程之旅-后篇
- 协程CPU密集场景调度实现
- 其他
- 函数列表
- swoole_set_process_name
- swoole_version
- swoole_strerror
- swoole_errno
- swoole_get_local_ip
- swoole_clear_dns_cache
- swoole_get_local_mac
- swoole_cpu_num
- swoole_last_error
- Swoole社区
- Swoole技术会议
- 工作组(Working Groups)
- 参与开源项目指引
- 捐赠Swoole项目
- 加入Swoole开发组
- 非协程特性独立扩展 (swoole_async)
- 附录:Linux信号列表
- 附录:Linux错误码(errno)列表
- 附录:Swoole错误码列表
- 附录:TCP连接的状态
- 附录:tcpdump抓包工具的使用
- 附录:strace工具的使用
- 附录:gdb工具的使用
- 附录:lsof工具的使用
- 附录:perf工具的使用
- 附录:编译PHP扩展的相关工具
- 备用:已移除的历史特性
- swoole_server->handler
- task_worker_max
- swoole_server->addtimer
- swoole_server->deltimer
- onTimer
- swoole_timer_add
- swoole_timer_del
- swoole_get_mysqli_sock
- swoole_mysql_query
- onMasterConnect
- onMasterClose
- Nginx/Golang/Swoole/Node.js的性能对比
- Coroutine::call_user_func
- Coroutine::call_user_func_array
- Coroutine\Channel::select
- task_async
- 历史:版本更新记录(1.x)
- 1.10.3
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.23
- 1.9.22
- 1.9.19
- 1.9.18
- 1.9.17
- 1.9.16
- 1.9.15
- 1.9.14
- 1.9.12
- 1.9.11
- 1.9.9
- 1.9.7
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.13
- 1.8.12
- 1.8.11
- 1.8.10
- 1.8.9
- 1.8.8
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.22
- 1.7.21
- 1.7.20
- 1.7.19
- 1.7.18
- 1.7.17
- 1.7.16
- 1.7.15
- 1.7.14
- 1.7.13
- 1.7.12
- 1.7.11
- 1.7.10
- 1.7.9
- 1.7.8
- 1.7.7
- 1.7.6
- 1.7.5
- v1.5
- v1.6
- v1.7
- 历史:版本更新记录(2.x)
- 2.0.1-Alpha
- 2.0.5
- 2.0.9
- 1.9.21
- 2.0.10
- 2.0.11
- 2.0.12
- 2.0.13
- 2.1.1
- 2.1.2
- 2.2.0
- 3.0.0
- 历史:版本更新记录(4.x)
- 4.0.3
- 4.0.2
- 4.0.4
- 4.1.1
- 4.1.2
- 4.2.1
- 4.2.2
- 4.2.3
- 4.2.4
- 4.2.5
- 4.2.6
- 4.2.7
- 4.2.9
- 4.2.8
- 社区文档版权申明
- 社区文档编辑条例