public function receive(&$header)
    {
        $body = $this->relay->receiveSync($flags);

        if ($flags & Relay::PAYLOAD_CONTROL) {
            if ($this->handleControl($body, $header, $flags)) {
                // wait for the next command
                return $this->receive($header);
            }

            // no context for the termination.
            $header = null;

            // Expect process termination
            return null;
        }

        if ($flags & Relay::PAYLOAD_ERROR) {
            return new \Error($body);
        }

        return $body;
    }