Boost logo

Boost Users :

Subject: [Boost-users] try, catch with boost.asio acceptor
From: Etienne Philip Pretorius (icewolfhunter_at_[hidden])
Date: 2008-10-13 14:21:07


How would someone get this right?

retry:
     try {
        boost::asio::local::stream_protocol::acceptor acceptor(m_service,endpoint);
     } catch (boost::system::system_error e) {
        if(e.code()==boost::system::errc::address_in_use) {
            std::remove("/tmp/someprogram.socket");
            goto retry;
        }
        throw;
     }

Etienne


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