Swoole\Server::shutdown()
关闭主服务器进程,这个函数可以在工作进程中调用
适用版本(PECL swoole >= 1.9.0) Swoole\Server::shutdown — 关闭主服务器进程,这个函数可以在工作进程中调用。 说明 public Swoole\Server::shutdown(): void 参数 此函数没有参数。 返回值
收录 8868 个 PHP 函数,含用途说明与用法示例。
本地收录 8868 条,找到 8868 条记录
关闭主服务器进程,这个函数可以在工作进程中调用
适用版本(PECL swoole >= 1.9.0) Swoole\Server::shutdown — 关闭主服务器进程,这个函数可以在工作进程中调用。 说明 public Swoole\Server::shutdown(): void 参数 此函数没有参数。 返回值
设置swole服务器的运行时设置
适用版本(PECL swoole >= 1.9.0) Swoole\Server::set — 设置swole服务器的运行时设置。 说明 public Swoole\Server::set(array $settings): ReturnType 设置swole服务器的运…
以阻塞方式向远程套接字发送数据。
适用版本(PECL swoole >= 1.9.0) Swoole\Server::sendwait — 以阻塞方式向远程套接字发送数据。 说明 public Swoole\Server::sendwait(int $fd, string $data): bool 警告 …
将数据发送到远端UDP地址。
适用版本(PECL swoole >= 1.9.0) Swoole\Server::sendto — 将数据发送到远端UDP地址。 说明 public Swoole\Server::sendto( string $ip, int $port, string $data, s…
通过ID向工作进程发送消息。
适用版本(PECL swoole >= 1.9.0) Swoole\Server::sendMessage — 通过ID向工作进程发送消息。 说明 public Swoole\Server::sendMessage(int $worker_id, string $data)…
将文件发送到连接。
适用版本(PECL swoole >= 1.9.0) Swoole\Server::sendfile — 将文件发送到连接。 说明 public Swoole\Server::sendfile(int $fd, string $filename, int $offset =…
向客户端发送数据。
适用版本(PECL swoole >= 1.9.0) Swoole\Server::send — 向客户端发送数据。 说明 public Swoole\Server::send(int $fd, string $data, int $reactor_id = ?): boo…
开始从连接接收数据。
适用版本(PECL swoole >= 1.9.0) Swoole\Server::resume — 开始从连接接收数据。 说明 public Swoole\Server::resume(int $fd): void 参数 fd 返回值
重新启动所有工作进程。
适用版本(PECL swoole >= 1.9.0) Swoole\Server::reload — 重新启动所有工作进程。 说明 public Swoole\Server::reload(): bool 参数 此函数没有参数。 返回值
将连接设置为保护模式
适用版本(PECL swoole >= 1.9.0) Swoole\Server::protect — 将连接设置为保护模式。 说明 public Swoole\Server::protect(int $fd, bool $is_protected = ?): void …
向下一个事件循环添加回调函数
适用版本(PECL swoole >= 1.9.0) swoole_event_defer — 向下一个事件循环添加回调函数 说明 swoole_event_defer(callable $callback): bool 参数 callback 返回值 成功时返回 tru…
在EventLoop中添加新的套接字回调函数
适用版本(PECL swoole >= 1.9.0) swoole_event_add — 在EventLoop中添加新的套接字回调函数 说明 swoole_event_add( int $fd, callable $read_callback = ?, callable …
将错误信息记录到 Swoole 的错误日志中
函数名:swoole_error_log() 适用版本:Swoole 4.3.0 或更高版本 用法:swoole_error_log() 函数用于将错误信息记录到 Swoole 的错误日志中。 示例: <?php // 引入 Swoole 扩展 require 'vend…
获取最近一次系统调用的错误码
适用版本(PECL swoole >= 1.9.0) swoole_errno — 获取最近一次系统调用的错误码 说明 swoole_errno(): int 参数 此函数没有参数。 返回值
获取当前系统的CPU核心数量
函数名:swoole_cpu_num() 适用版本:Swoole 1.9.0以上版本 用法:swoole_cpu_num()函数用于获取当前系统的CPU核心数量。 示例: // 引入Swoole扩展 require_once 'path/to/swoole/autoloa…
获取准备读/写或错误的文件描述
适用版本(PECL swoole >= 1.9.0) swoole_client_select — 获取准备读/写或错误的文件描述 说明 swoole_client_select( array &$read_array, array &$write_array, array…
清除套接字或最后一个错误代码上的错误
适用版本(PECL swoole >= 4.6.0) swoole_clear_error — 清除套接字或最后一个错误代码上的错误 说明 swoole_clear_error(): void 清除套接字或最后一个错误代码上的错误。 参数 此函数没有参数。 返回值 没有…
将数据异步写入文件
函数名:swoole_async_writefile() 适用版本:Swoole 1.9.0以上版本 用法:swoole_async_writefile(string $filename, string $content, callable $callback = null,…
异步写入数据到文件或socket
函数名称:swoole_async_write() 适用版本:Swoole 1.9.0及以上版本 函数描述:swoole_async_write()函数用于异步写入数据到文件或socket。 用法: swoole_async_write(string $filename,…
设置异步IO的相关选项
函数名称:swoole_async_set() 适用版本:Swoole 1.8.0+ 函数说明:swoole_async_set()函数用于设置异步IO的相关选项。 函数原型:bool swoole_async_set(array $settings) 参数说明: $s…
异步读取文件内容
函数名:swoole_async_readfile() 适用版本:Swoole 1.9.0以上版本 用法:swoole_async_readfile(string $filename, callable $callback, int $chunk_size = 8192, i…
异步读取文件流
函数名:swoole_async_read() 适用版本:Swoole 1.9.0+ 用法:swoole_async_read(int $fd, int $size, int $offset = 0, callable $callback = null) 参数: $fd:…
获取一组二进制数据以在单个帧中发送
适用版本(PECL swoole >= 1.9.0) Swoole\WebSocket\Server::pack — 获取一组二进制数据以在单个帧中发送。 说明 public static Swoole\WebSocket\Server::pack( string $dat…
将数据推送到远程客户端
适用版本(PECL swoole >= 1.9.0) Swoole\WebSocket\Server::push — 将数据推送到远程客户端。 说明 public Swoole\WebSocket\Server::push( string $fd, string $data…