From: BRIDGES Dick (Dick.Bridges_at_[hidden])
Date: 2005-10-04 12:20:48
> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of
> Christopher Kohlhoff
> Sent: Monday, October 03, 2005 3:01 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] [asio] init acceptor to reuse_address?
> Hi Dick,
> --- BRIDGES Dick <Dick.Bridges_at_[hidden]> wrote:
> > Mumbling something about defaulting modern socket libraries
> > to SO_REUSEADDR,
> Do you think I should change the default to set SO_REUSEADDR to true?
> At the moment I leave all options to default to whatever the OS
> provides. Is there a good reason why all OSes (that I know of) have it
> default to false I wonder? Or is it just historical?
No. SO_REUSEADDR does increase the attack surface. Not a lot and less
now than in the past but IMHO there's no point in helping the bad guys
even a little bit if it's not required. Besides, I doubt all that many
people would find it useful. My mumbling was aimed more toward myself
than anything else - I have written a fair amount of "server" code and
should have developed better habits by now. ;)
> asio::ipv4::tcp::endpoint endpoint(port);
> boost::bind(&server::handle_accept, this,
> (From the new http example I've written:
Hmmm. The copy of the library I downloaded on 14 September doesn't
have socket_acceptor::reuse_address and linux.softpedia.com says the
last update was 5 September. I used stream_socket::reuse_address
instead and that worked. Is there a newer version of the library
Other than that one substitution, this fixed the problem.
I would like to see this initialization code pushed back down into
the acceptor. Maybe something along the lines of an "option_policy",
but I can't come up with anything to suggest that isn't more trouble
than it's worth.
Thanks - *AGAIN* - for the help.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk