public function handleData()
    {
        if ($this->paused || $this->resourcesCounter === 0)
        {
            return;
        }

        // handle all reading
        foreach ($this->resources as $resource)
        {
            if (!$resource->isPaused() && $resource->isReadable())
            {
                $resource->handleRead();
            }
        }

        // handle all writing
        foreach ($this->resources as $resource)
        {
            if (!$resource->isPaused() && $resource->isWritable())
            {
                $resource->handleWrite();
            }
        }
    }