diff options
author | Steve Huston <shuston@riverace.com> | 2010-08-27 15:03:31 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2010-08-27 15:03:31 +0000 |
commit | bef8011bfe74be69f5b81e6b7856b3278dbf0b40 (patch) | |
tree | 510b317bb24553b85785491501831dbfa081ddc0 | |
parent | ae5b1b0e9254ebfcd532be1bf2537d566ad24a3d (diff) | |
download | ATCD-bef8011bfe74be69f5b81e6b7856b3278dbf0b40.tar.gz |
ChangeLogTag:Fri Aug 27 15:01:41 UTC 2010 Steve Huston <shuston@smokey.mro.riverace.com>
-rw-r--r-- | ACE/ChangeLog | 12 | ||||
-rw-r--r-- | ACE/THANKS | 1 | ||||
-rw-r--r-- | ACE/ace/Connector.cpp | 18 | ||||
-rw-r--r-- | ACE/ace/Connector.h | 3 |
4 files changed, 32 insertions, 2 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 1399e01fbaf..1fecb7b6273 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,15 @@ +Fri Aug 27 15:01:41 UTC 2010 Steve Huston <shuston@smokey.mro.riverace.com> + + * Connector.{h cpp} (ACE_NonBlocking_Connect_Handler): Add a + handle_close() which calls handle_input() if called by the + ACE_Dev_Poll_Reactor to remove a failed connect. Apparently, + Linux epoll, at least sometimes, signals EPOLLERR on a failed + nonblocking connect, unlike the select() case which selects the + failed fd for read. Thanks to Kannan Ramaswamy <kannan dot + ramaswamy at cogcap dot com> for this information and fix. + + * THANKS: Added Kannan to the Hall of Fame. + Fri Aug 27 14:17:56 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl> * ace/Atomic_Op.h: diff --git a/ACE/THANKS b/ACE/THANKS index 83f1f0eac81..16498f75b24 100644 --- a/ACE/THANKS +++ b/ACE/THANKS @@ -2330,6 +2330,7 @@ Max Zhou <earthdog at 126 dot com> Daynesh Mangal <daynesh at gmail dot com> Robert Shectman <shectman at llnl dot gov> Rafi <rafi dot net at gmail dot com> +Kannan Ramaswamy <kannan dot ramaswamy at cogcap dot com> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson in the early 1990's. Paul devised the recursive Makefile diff --git a/ACE/ace/Connector.cpp b/ACE/ace/Connector.cpp index 867fc572384..894a7fb4762 100644 --- a/ACE/ace/Connector.cpp +++ b/ACE/ace/Connector.cpp @@ -121,9 +121,9 @@ ACE_NonBlocking_Connect_Handler<SVC_HANDLER>::close (SVC_HANDLER *&sh) return false; // Remove from Reactor. - if (this->reactor ()->remove_handler ( + if (-1 == this->reactor ()->remove_handler ( h, - ACE_Event_Handler::ALL_EVENTS_MASK) == -1) + ACE_Event_Handler::ALL_EVENTS_MASK | ACE_Event_Handler::DONT_CALL)) return false; } @@ -174,6 +174,20 @@ ACE_NonBlocking_Connect_Handler<SVC_HANDLER>::handle_input (ACE_HANDLE) } template <class SVC_HANDLER> int +ACE_NonBlocking_Connect_Handler<SVC_HANDLER>::handle_close (ACE_HANDLE handle, + ACE_Reactor_Mask m) +{ + // epoll on Linux will, at least sometimes, return EPOLLERR when a connect + // fails, triggering a total removal from the reactor. This is different from + // select()-based systems which select the fd for read on a connect failure. + // So just call handle_input() to rejoin common handling for a failed + // connect. + if (m == ACE_Event_Handler::ALL_EVENTS_MASK) + return this->handle_input (handle); + return -1; +} + +template <class SVC_HANDLER> int ACE_NonBlocking_Connect_Handler<SVC_HANDLER>::handle_output (ACE_HANDLE handle) { // Called when a connection is establishment asynchronous. diff --git a/ACE/ace/Connector.h b/ACE/ace/Connector.h index 6e7a274c5a4..0063d9498b8 100644 --- a/ACE/ace/Connector.h +++ b/ACE/ace/Connector.h @@ -102,6 +102,9 @@ public: /// Called by ACE_Reactor when asynchronous connections fail. virtual int handle_input (ACE_HANDLE); + /// Called by ACE_Dev_Poll_Reactor when asynchronous connections fail. + virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask); + /// Called by ACE_Reactor when asynchronous connections succeed. virtual int handle_output (ACE_HANDLE); |