swoole_async_dns_lookup

Async and non-blocking hostname to IP lookup

说明

bool swoole_async_dns_lookup ( string $hostname , callable $callback )

参数

hostname
The host name.

callback
mixed callback ( string $hostname , string $ip )

hostname
The host name.

IP
The IP address.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

swoole_async_read

Read file stream asynchronously

说明

bool swoole_async_read ( string $filename , callable $callback [, int $chunk_size = 65536 [, int $offset = 0 ]] )

参数

filename
The filename of the file being read.

callback
mixed callback ( string $filename , string $content )

filename
The name of the file.

content
The content readed from the file stream.

chunk_size
The chunk length.

offset
The offset.

返回值

Whether the read is succeed.

swoole_async_readfile

Read a file asynchronously

说明

bool swoole_async_readfile ( string $filename , callable $callback )

参数

filename
The filename of the file being read.

callback
mixed callback ( string $filename , string $content )

filename
The name of the file.

content
The content readed from the file.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

swoole_async_set

Update the async I/O options

说明

void swoole_async_set ( array $settings )

参数

settings

swoole_async_write

Write data to a file stream asynchronously

说明

bool swoole_async_write ( string $filename , string $content [, integer $offset [, callable $callback ]] )

参数

filename
The filename being written.

content
The content writing to the file.

offset
The offset.

callback

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

swoole_async_writefile

Write data to a file asynchronously

说明

bool swoole_async_writefile ( string $filename , string $content [, callable $callback [, int $flags = 0 ]] )

参数

filename
The filename being written.

content
The content writing to the file.

callback

flags

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

swoole_client_select

Get the file description which are ready to read/write or error

说明

int swoole_client_select ( array &$read_array , array &$write_array , array &$error_array [, float $timeout = 0.5 ] )

参数

read_array

write_array

error_array

timeout

返回值

swoole_cpu_num

Get the number of CPU

说明

int swoole_cpu_num ( void )

参数

此函数没有参数。

返回值

The number of CPU.

swoole_errno

Get the error code of the latest system call

说明

int swoole_errno ( void )

参数

此函数没有参数。

返回值

swoole_event_add

Add new callback functions of a socket into the EventLoop

说明

int swoole_event_add ( int $fd [, callable $read_callback [, callable $write_callback [, int $events = 0 ]]] )

参数

fd

read_callback

write_callback

events

返回值

swoole_event_defer

Add callback function to the next event loop

说明

bool swoole_event_defer ( callable $callback )

参数

callback

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

swoole_event_del

Remove all event callback functions of a socket

说明

bool swoole_event_del ( int $fd )

参数

fd

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

swoole_event_exit

Exit the eventloop, only available at the client side

说明

void swoole_event_exit ( void )

参数

此函数没有参数。

返回值

swoole_event_set

Update the event callback functions of a socket

说明

bool swoole_event_set ( int $fd [, callable $read_callback [, callable $write_callback [, int $events = 0 ]]] )

参数

fd

read_callback

write_callback

events

返回值

swoole_event_wait

Start the event loop

说明

void swoole_event_wait ( void )

参数

此函数没有参数。

返回值

swoole_event_write

Write data to a socket

说明

bool swoole_event_write ( int $fd , string $data )

参数

fd

data

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

swoole_get_local_ip

Get the IPv4 IP addresses of each NIC on the machine

说明

array swoole_get_local_ip ( void )

参数

此函数没有参数。

返回值

swoole_last_error

Get the lastest error message

说明

int swoole_last_error ( void )

参数

此函数没有参数。

返回值

swoole_load_module

Load a swoole extension

说明

mixed swoole_load_module ( string $filename )

参数

此函数没有参数。

返回值

swoole_select

Select the file descriptions which are ready to read/write or error in the eventloop

说明

int swoole_select ( array &$read_array , array &$write_array , array &$error_array [, float $timeout ] )

参数

read_array

write_array

error_array

timeout

返回值

swoole_set_process_name

Set the process name

说明

void swoole_set_process_name ( string $process_name [, int $size = 128 ] )

参数

process_name

返回值

swoole_strerror

Convert the Errno into error messages

说明

string swoole_strerror ( int $errno [, int $error_type = 0 ] )

参数

errno

返回值

swoole_timer_after

Trigger a one time callback function in the future

说明

int swoole_timer_after ( int $ms , callable $callback [, mixed $param ] )

参数

ms

callback

param

返回值

swoole_timer_exists

Check if a timer callback function is existed

说明

bool swoole_timer_exists ( int $timer_id )

参数

timer_id

返回值

swoole_timer_tick

Trigger a timer tick callback function by time interval

说明

int swoole_timer_tick ( int $ms , callable $callback [, mixed $param ] )

参数

ms

callback

返回值

swoole_version

Get the version of Swoole

说明

string swoole_version ( void )

参数

此函数没有参数。

返回值

The version of Swoole.

目录