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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:42:53+00:00 2026-06-17T09:42:53+00:00

I working on a client/server application using boost asio, specifically boost::asio::ip::tcp::socket to connect and

  • 0

I working on a client/server application using boost asio, specifically boost::asio::ip::tcp::socket to connect and transfer data. Right now I am using boost::asio::async_read to recive a certain amount of bytes. Until now, in all cases I know how many bytes I want to receive, before calling my handler. Therefore I don’t see a reason to use the sockets meber function read_some. But I wonder why there is no “async_read” member function of boost::asio::ip::tcp::socket but only the free one.

So my question is: Are there conceptual or technical reasons why there is a read_some member function but no readmember function, or did “Boost just forgot to implement it” ?

  • 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-17T09:42:54+00:00Added an answer on June 17, 2026 at 9:42 am

    All of the streaming interfaces in Asio provide both read_some and async_read_some moethods. This is true for the TCP sockets, SSL streams, and Serial ports. The implementation of read, read_until, and their async cousins all have the same implementations, based on using the read_some method. The read function is written as a generic template, that can use the read_some method on its first argument to perform the call as you requested.

    There are some C++ advocates that recommend using non-friend non-member functions whenever possible, so as to minimize the changes when a class implementation changes. read_some is the interface, and read is just a wrapper that adds blocking in the case of partial reads for a variety of different sources.

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

Sidebar

Related Questions

I am working on TCP client server application using c++.third party lib are now
I am working on a client-server application that uses boost::serialization library for it's serialization
I'm using .NET 3.5 and WCF for developing a server-client application. Binding=BasicHttp. I'm working
I am working on a client/server (WPF/WCF) application using the MVVM pattern. Properties on
I have got a Client/Server Application that using Asynchronous Socket.My problem is i cant
I have client server application using distributed object. some time my code is working
I am writing a client-server application using TCP Sockets. The server is written in
I am working on a client/server application and communication between the two is encrypted.
I'm working on a client-server application (.NET 4, WCF) that must support backwards compatibility.
I'm working on a client-server Android application and trying to figure out how to

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.