Re: [Boost-bugs] [Boost C++ Libraries] #2832: Asio sync IO functions need timeout parameters

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2832: Asio sync IO functions need timeout parameters
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-01 04:00:42

#2832: Asio sync IO functions need timeout parameters
  Reporter: Stephan Menzel <stephan.menzel@…> | Owner: chris_kohlhoff
      Type: Bugs | Status: closed
 Milestone: Boost 1.39.0 | Component: asio
   Version: Boost 1.38.0 | Severity: Problem
Resolution: wontfix | Keywords:

Comment (by anonymous):

 I'd like to also throw in my 2 cents in favor of having this added in for
 synchronous sockets. There is at least one use case where it's far easier
 to simple have a synchronous socket with a timeout than do the async
 method. For example, I'm writing a sort of local DNS server right now
 where I need to forward out requests to an external nameserver in certain
 cases. So essentially I have a simple setup where I have a single service
 running and a async handle send/onSent method.

 So in each of these threads is where I must decode and read the incoming
 request and choose to forward it or not. In order to use the async way I
 need to basically have a socket running on a different service so when I
 call run() on that service, it's blocking until the async receive with
 timeout completes. If I set that socket up (for external resolution) to
 use my existing io service, guess what, I can use the run() call to be
 blocking within the current thread... so easy solution is to have a
 synchronous call for external resolution... but then since I can't put a
 timeout on it, if one call fails my whole program locks. Bad. We could
 argue for days about how to change the structure of my program to be
 "better".... or we could simply have a synchronous timeout and then
 everything works beautifully and logically. Now I've got to come up with
 platform specific hacks to make this work....

 Don't get me wrong, open source is great, the work is much appreciated. As
 someone who has open sourced tens of thousands of lines of code in my
 career, I understand the frustration when someone whines about my hard
 work that I've given away for free.. but emotions aside, if they're right,
 they're right.

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC