response


  
      function set_response()
      {
          fwrite(this->socket, this->request_headers);
          response = '';
  
          do
          {
              data = fread(this->socket, 8192);
              response .= data;
          }   
          while (strlen(data) != 0);
  
          fclose(this->socket);
          preg_match("#(.*?)\r\n\r\n(.*)#s", response, matches);
  
          this->response_headers = matches[1];
          this->response_body    = matches[2];
      }