protected function processInputBuffer()
    {
        $this->logger->debug("Processing WS request...");

        try {
            if ($this->currentFrame === null) //No frame in processing - new need to be build
            {
                $this->logger->debug("Creating new frame in client");
                $this->currentFrame = new NetworkFrame($this->logger, $this->inputBuffer);
            }

            if (!$this->currentFrame->isComplete()) {
                $this->logger->debug("Frame not completed yet, skipping processing");

                return true;
            }

            if(!$this->currentFrame->isMasked()) {
                throw new WebSocketException("Client to server frames must be masked", DataFrame::CODE_PROTOCOL_ERROR);
            }

            //Current frame is completed, this call also "kick" the frame to try fetching new data from buffer (if any)
            $this->routeCurrentFrame();

            return empty($this->inputBuffer); //This method will be called again if buffer is not empty

        } catch(Exception $e) {
            $this->handleWebSocketException($e);

            return true; //handleWebSocketException() will disconnect client, so it's useless to parse buffer
        }
    }