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 8371867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:15:51+00:00 2026-06-09T14:15:51+00:00

Maybe I am misunderstanding how things work, but I am trying to add a

  • 0

Maybe I am misunderstanding how things work, but I am trying to add a timeout to a read_until call, so I created a deadline_timer and started it before calling read_until, but the read_until still blocks everything, and the timer never gets activated. Am I doing it wrong? Below are some snippets from my code.

void MyClass::handle_timeout(const boost::system::error_code& error)
{
    // Our deadline timer went off.
    std::cout << "Deadline Timer was triggered." << std::endl;
    Disconnect();
}

// Read some data.
void MyClass::ReadData(){
            boost::asio::streambuf response;
            deadline_.expires_from_now(boost::posix_time::seconds(DEFAULT_TIMEOUT));
            deadline_.async_wait(boost::bind(&MyClass::handle_timeout, this, _1));

            boost::asio::read_until(socket_,response,asString);
}
  • 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-09T14:15:53+00:00Added an answer on June 9, 2026 at 2:15 pm

    you’re misunderstanding how things work. If you desire cancelability, you need to use the asynchronous methods such as

    boost::asio::async_read_until(...);
    

    instead of

    boost::asio::read_until(socket_,response,asString);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

maybe this is just a little misunderstanding but how can a programming language be
Maybe I'm misunderstanding something about transactions or what SQL Server is doing but consider
I may be misunderstanding how <include> and <merge> work, but according to Simple example
Maybe I'm misunderstanding something (quite possible as I'm new to Backbone), but I can't
maybe I'm just misunderstanding Javascript's regular expression functionality but here goes... I have an
Maybe I'm misunderstanding how inheritance works here, but here's my problem: I have a
Maybe I am misunderstanding the use of the P99 library but what advantages does
Maybe the title is a little missleading but I'd like to ask you for
Maybe my title is not the best but here is what I really want.I
Maybe it's because of the dark outside, but I can't get this Position geom_text

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.