+ $this->driver->disable($id);
+ }
+ switch ($poll) {
+ case self::POLL_NONE:
+ break;
+ case self::POLL_IN:
+ $id = $this->driver->onReadable($socket, function($id, $socket) {
+ $this->run($socket, self::POLL_IN);
+ });
+ $this->driver->setState((string) $socket, $id);
+ break;
+ case self::POLL_OUT:
+ $id = $this->driver->onWritable($socket, function($id, $socket) {
+ $this->run($socket, self::POLL_OUT);
+ });
+ $this->driver->setState((string) $socket, $id);
+ break;
+ case self::POLL_INOUT:
+ $id = [
+ $this->driver->onReadable($socket, function($id, $socket) {
+ $this->run($socket, self::POLL_IN);
+ }),
+ $this->driver->onWritable($socket, function($id, $socket) {
+ $this->run($socket, self::POLL_OUT);
+ })
+ ];
+ $this->driver->setState((string) $socket, $id);
+ break;
+ case self::POLL_REMOVE:
+ foreach ((array) $this->driver->getState((string) $socket) as $id) {
+ $this->driver->cancel($id);
+ }
+ $this->driver->setState((string) $socket, null);
+ break;