public function checkClient()
    {
        /* if a new connection is being made add it to the client array */
        if (in_array($this->_socket_http, $this->read)) {
            for ($i = 0; $i < $this->max_clients; $i++) {
                if (isset($this->client[$i]) && $this->client[$i]['sock'] == null) {
                    $this->client[$i]['sock'] = @socket_accept($this->_socket_http);
                    break;
                } elseif ($i == $this->max_clients - 1) {
                    //die ("too many clients $i");
                } else {
                    $this->client[] = ['sock' => @socket_accept($this->_socket_http)];
                    break;
                }
            }

            if (--$this->ready <= 0) {
                return false;
            }
        } // end if in_array

        return true;
    }