$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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