Swoole\Event::addAdd a socket to the underlying reactor event listener 説明
public static bool Swoole\Event::add(
mixed $sock,callable $read_callback,callable $write_callback = ?,int $flags = ?) Adds a socket to the underlying reactor event listener. This function can be used in both Server and Client modes. 警告
A socket that has already been added cannot be added again. Use swoole_event_set to modify the corresponding callback functions and event types for the socket. パラメータ
戻り値
成功した場合に 例
例1 Swoole\Event::add example |