Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9291921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:45:38+00:00 2026-06-18T20:45:38+00:00

Background I am writing a multi-threaded, websocket server in C++. Problem When I try

  • 0

Background

I am writing a multi-threaded, websocket server in C++.

Problem

When I try to integrate my HTTP parser, MKFAHTTPRequest Request( std::string( Buffer ) ); gets completely skipped during execution.

I’ve cleaned the project and added -Wall and -Werror (which should tell me that Request is an unused variable, but it doesn’t).

void operator()(){
    while( true ){
        if( m_Socket->is_open() ){
            char Buffer[1024]; 

            boost::system::error_code Error; 

            std::cout << "MKFAConnection::operator()() - Reading..." << std::endl;
            m_Socket->read_some( boost::asio::buffer( Buffer, sizeof( Buffer ) ), Error ); 

            if( !Error ){
                // This line is getting skipped!?!?!?
                MKFAHttpRequest Request( std::string( Buffer ) );

                m_Socket->write_some( boost::asio::buffer( std::string( "Hello World" ) ) ); 

            } else break; 

        } else break; 

    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T20:45:39+00:00Added an answer on June 18, 2026 at 8:45 pm
    MKFAHttpRequest Request( std::string( Buffer ) );
    

    This line doesn’t do what you think it does. You think it defines an object named Request of type MKFAHttpRequest and initializes the object with a temporary object of type std::string.

    In fact, it declares a function named Request which accepts a single parameter of type std::string and returns an object of type MKFAHttpRequest.

    This is related to (or perhaps an example of) the most vexing parse.

    Perhaps one of these will make it better:

    MKFAHttpRequest Request( (std::string( Buffer )) );
    MKFAHttpRequest Request{ std::string( Buffer ) };
    MKFAHttpRequest Request = std::string( Buffer );
    MKFAHttpRequest Request = MKFAHttpRequest(std::string( Buffer ));
    

    Ref: http://en.wikipedia.org/wiki/Most_vexing_parse

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I'm writing an web application so I can control an Ubuntu Server from
Background: Writing a websocket. Works fine in Chrome. Single connection. Works fine in Firefox,
Background: I'm writing a Java server application that needs to perform basic interactions with
Background: I am writing a flash game and have encountered a problem. I have
As a newbie to Python, and mainly having a background of writing scripts for
Background: I'm writing a 'standard' (nothing special) web application in Ruby (not Rails) and
Background: I am writing a C++ program working with large amounts of geodata, and
Background I am writing a program that targets several different phones, including the iPhone.
Background I'm writing an adapter for ESE to .NET and LINQ in a Google
Background I am writing a survey that is going to a large audience. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.