Swoole
PHP Manual

The Swoole\Server class

(PHP 5 >= 5.2.0, PHP 7, PECL swoole >= 1.9.0)

简介

类摘要

Swoole\Server {
/* 方法 */
public void addlistener ( string $host , integer $port , string $socket_type )
public boolean addProcess ( swoole_process $process )
public ReturnType after ( integer $after_time_ms , callable $callback [, string $param ] )
public boolean bind ( integer $fd , integer $uid )
public void clearTimer ( integer $timer_id )
void swoole_timer_clear ( integer $timer_id )
public boolean close ( integer $fd [, boolean $reset ] )
public boolean confirm ( integer $fd )
public array connection_info ( integer $fd [, integer $reactor_id ] )
public array connection_list ( integer $start_fd [, integer $pagesize ] )
public void defer ( callable $callback )
public void Swoole\Server\Port::__destruct ( void )
public ReturnType Swoole\Server\Port::on ( string $event_name , callable $callback )
public void Swoole\Server\Port::set ( array $settings )
public boolean exist ( integer $fd )
public void finish ( string $data )
public ReturnType getClientInfo ( integer $fd [, integer $reactor_id ] )
public array getClientList ( integer $start_fd [, integer $pagesize ] )
public integer getLastError ( void )
public mixed heartbeat ( boolean $if_close_connection )
public boolean listen ( string $host , integer $port , string $socket_type )
public void on ( string $event_name , callable $callback )
public void pause ( integer $fd )
public void protect ( integer $fd [, boolean $is_protected ] )
public boolean reload ( void )
public void resume ( integer $fd )
public boolean send ( integer $fd , string $data [, integer $reactor_id ] )
public boolean sendfile ( integer $fd , string $filename [, integer $offset ] )
public boolean sendMessage ( integer $worker_id , string $data )
public boolean sendto ( string $ip , integer $port , string $data [, string $server_socket ] )
public boolean sendwait ( integer $fd , string $data )
public ReturnType set ( array $settings )
public void shutdown ( void )
public void start ( void )
public array stats ( void )
public boolean stop ([ integer $worker_id ] )
public mixed task ( string $data [, integer $dst_worker_id [, callable $callback ]] )
public void taskwait ( string $data [, float $timeout [, integer $worker_id ]] )
public void taskWaitMulti ( array $tasks [, double $timeout_ms ] )
public void tick ( integer $interval_ms , callable $callback )
}

Table of Contents


Swoole
PHP Manual