Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2005-10-03 17:01:02

Hi Dick,

--- BRIDGES Dick <Dick.Bridges_at_[hidden]> wrote:
> Everything works fine except when I (1) connect a client;
> (2) ^C the server; (3) try to restart the server - which, as
> expected, yields "Address already in use".
> Mumbling something about defaulting modern socket libraries

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?

> I started trying to figure out where to call
> set_option(stream_socket::reuse_address(true)) - and can't
> work it out. I've set_option() on sockets and the acceptor
> but can't make the acceptor reuse the address as long as the
> connection that was established is still in TIME_WAIT. Do you
> have an example that shows how this can be done?

  asio::ipv4::tcp::endpoint endpoint(port);;
      boost::bind(&server::handle_accept, this,

(From the new http example I've written:


Boost list run by bdawes at, gregod at, cpdaniel at, john at