|
Boost Users : |
Subject: Re: [Boost-users] [asio] How to deal with no-connect and/or read-timeout
From: Arash Partow (arash_at_[hidden])
Date: 2013-06-26 18:02:20
On 27/06/2013, Nat Linden <nat_at_[hidden]> wrote:
> On Wed, Jun 26, 2013, Arash Partow wrote:
>
>> On 26/06/2013, Bjorn Reese wrote:
>
>>> Could you provide some guidance about the pros and cons of
>>> Context versus Fiber versus Coroutine so that we are in a better
>>> position to select the appropriate module?
>
>> Not guidance per se but here's a nice example:
>>
>> https://github.com/chriskohlhoff/asio/blob/master/asio/src/examples/cpp11/spawn/echo_server.cpp
>
> It's an asio example, but doesn't address the question about Context,
> Coroutine or Fiber.
>
Well actually it does.
The trick is to click the link, read and comprehend the code example, at which point an astute individual may realize that CK has gone to a lot of effort to integrate coroutine semantics into stock asio within the context of C++11.
So then it becomes a question of:
1. Do I use another library to provide the functionality I think I may need?
or
2. Should I better familiarize myself with the available facilities (which btw have been designed for the use case the library deals with) in the current library?
Oh and btw the example quoted above quite clearly deals with the OP's original problem in a clean, efficient and simple to understand manner and so to the many other examples related to timeouts in the asio example set, all it takes is a bit of tinkering.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net