Boost logo

Boost Users :

Subject: [Boost-users] Boost asio lib question: async_accept and EBADF
From: olegb_at_[hidden]
Date: 2011-04-18 03:07:41


Cheers,

I have a question regarding handling error bad file descriptor in asio
async_accept. Standard example doesn't expose whether it's fatal or
not. If I understand correctly bad_descriptor error is not fatal here,
like it would be for usual POSIX accept() call, and we should continue
accepting new incoming calls, no?

void handle_accept(tcp_connection::pointer new_connection,
       const boost::system::error_code& error)
   {
     if (!error)
     {
       new_connection->start();
       start_accept();
     }
   }

e.g.
     if (!error)
     {
       new_connection->start();
       start_accept();
     } else if (error == bad_descriptor) {
       start_accept();
     }

-- 
King regards,
Oleh

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