Swoole\Event::addAdd a socket to the underlying reactor event listener Description
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. Warning
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. Parameters
Return Values
Returns Examples
Example #1 Swoole\Event::add example |