Server
class Server (View source)
Properties
$setting | |||
$connections | |||
$host | |||
$port | |||
$type | |||
$mode | |||
$ports | |||
$master_pid | |||
$manager_pid | |||
$worker_id | |||
$taskworker | |||
$worker_pid | |||
$stats_timer | |||
Server
Since: 4.8.0
|
$admin_server |
Methods
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Get the ID of current worker (either an event worker or a task worker).
Get the process ID of a given worker process (specified by a worker ID).
No description
Run a customized command in a specified process of Swoole.
Add a customized command.
No description
No description
No description
No description
No description
No description
No description
No description
Alias of method \Swoole\Timer::after().
Alias of method \Swoole\Timer::tick().
Alias of method \Swoole\Timer::clear().
Alias of method \Swoole\Event::defer().
Details
__construct($host, $port = null, $mode = null, $sock_type = null)
No description
__destruct()
No description
mixed
listen(mixed $host, mixed $port, mixed $sock_type)
No description
mixed
addlistener(mixed $host, mixed $port, mixed $sock_type)
No description
mixed
on(mixed $event_name, callable $callback)
No description
mixed
getCallback(mixed $event_name)
No description
mixed
set(array $settings)
No description
mixed
start()
No description
mixed
send(mixed $fd, mixed $send_data, mixed|null $server_socket = null)
No description
mixed
sendto(mixed $ip, mixed $port, mixed $send_data, mixed|null $server_socket = null)
No description
mixed
sendwait(mixed $conn_fd, mixed $send_data)
No description
mixed
exists(mixed $fd)
No description
mixed
exist(mixed $fd)
No description
mixed
protect(mixed $fd, mixed|null $is_protected = null)
No description
mixed
sendfile(mixed $conn_fd, mixed $filename, mixed|null $offset = null, mixed|null $length = null)
No description
mixed
close(mixed $fd, mixed|null $reset = null)
No description
mixed
confirm(mixed $fd)
No description
mixed
pause(mixed $fd)
No description
mixed
resume(mixed $fd)
No description
mixed
task(mixed $data, mixed|null $worker_id = null, callable|null $finish_callback = null)
No description
mixed
taskwait(mixed $data, mixed|null $timeout = null, mixed|null $worker_id = null)
No description
mixed
taskWaitMulti(array $tasks, mixed|null $timeout = null)
No description
mixed
taskCo(array $tasks, mixed|null $timeout = null)
No description
mixed
finish(mixed $data)
No description
mixed
reload()
No description
mixed
shutdown()
No description
mixed
stop(mixed|null $worker_id = null)
No description
mixed
getLastError()
No description
mixed
heartbeat(mixed $reactor_id)
No description
mixed
getClientInfo(mixed $fd, mixed|null $reactor_id = null)
No description
mixed
getClientList(mixed $start_fd, mixed|null $find_count = null)
No description
int|false
getWorkerId()
Get the ID of current worker (either an event worker or a task worker).
int|false
getWorkerPid(int $worker_id = -1)
Get the process ID of a given worker process (specified by a worker ID).
mixed
getWorkerStatus(mixed|null $worker_id = null)
No description
mixed|false
command(string $name, int $process_id, int $process_type, mixed $data, bool $json_decode = true)
Run a customized command in a specified process of Swoole.
bool
addCommand(string $name, int $accepted_process_types, callable $callback)
Add a customized command.
Commands can be added to the master process, the manager process, or worker processes. Commands can only be added before the server is started.
mixed
getManagerPid()
No description
mixed
getMasterPid()
No description
mixed
connection_info(mixed $fd, mixed|null $reactor_id = null)
No description
mixed
connection_list(mixed $start_fd, mixed|null $find_count = null)
No description
mixed
sendMessage(mixed $message, mixed $dst_worker_id)
No description
int|false
addProcess(Process $process)
No description
mixed
stats()
No description
mixed
getSocket(mixed|null $port = null)
No description
mixed
bind(mixed $fd, mixed $uid)
No description
int
after(int $ms, callable $callback, ...$params)
Alias of method \Swoole\Timer::after().
int
tick(int $ms, callable $callback, ...$params)
Alias of method \Swoole\Timer::tick().
bool
clearTimer(int $timer_id)
Alias of method \Swoole\Timer::clear().
true
defer(callable $callback)
Alias of method \Swoole\Event::defer().