2024 日本 PHP 研討會

Swoole\Server 類別

(PECL swoole >= 1.9.0)

簡介

類別概要

類別 Swoole\Server {
/* 方法 */
公開 addlistener(字串 $host, 整數 $port, 字串 $socket_type):
公開方法 addProcess(swoole_process $process): 布林值
公開方法 after(整數 $after_time_ms, 可呼叫 $callback, 字串 $param = ?): ReturnType
公開方法 bind(整數 $fd, 整數 $uid): 布林值
公開方法 clearTimer(整數 $timer_id):
swoole_timer_clear(整數 $timer_id):
公開方法 close(整數 $fd, 布林值 $reset = ?): 布林值
公開方法 confirm(整數 $fd): 布林值
公開方法 connection_info(整數 $fd, 整數 $reactor_id = ?): 陣列
公開方法 connection_list(整數 $start_fd, 整數 $pagesize = ?): 陣列
公開方法 defer(可呼叫 $callback):
公開方法 Swoole\Server\Port::on(字串 $event_name, 可呼叫 $callback): ReturnType
公開方法 Swoole\Server\Port::set(陣列 $settings):
公開 exist(int $fd): bool
公開 finish(string $data): void
公開 getClientInfo(int $fd, int $reactor_id = ?, bool $ignore_error = ?): array
公開 getClientList(int $start_fd, int $pagesize = ?): array
公開 getLastError(): int
公開 heartbeat(bool $if_close_connection): mixed
公開 listen(string $host, int $port, string $socket_type): bool
公開 on(string $event_name, callable $callback): void
公開 pause(int $fd): void
公開 protect(int $fd, bool $is_protected = ?): void
公開 reload(): bool
公開 resume(int $fd): void
公開 send(int $fd, string $data, int $reactor_id = ?): bool
公開 sendfile(int $fd, string $filename, int $offset = ?): bool
公開 sendMessage(int $worker_id, string $data): bool
公開 sendto(
    string $ip,
    int $port,
    string $data,
    string $server_socket = ?
): bool
公開 sendwait(int $fd, string $data): bool
公開 set(array $settings): 傳回類型
公開 shutdown(): void
公開 start(): void
公開 stats(): array
公開 stop(int $worker_id = ?): bool
公開 task(string $data, int $dst_worker_id = ?, callable $callback = ?): 混合類型
public taskwait(string $data, float $timeout = ?, int $worker_id = ?): void
public taskWaitMulti(array $tasks, float $timeout_ms = ?): void
public tick(int $interval_ms, callable $callback): void
}

目錄

新增註記

使用者提供的註記

此頁面沒有使用者提供的註記。
To Top