summaryrefslogtreecommitdiff
path: root/ace/Asynch_Connector.h
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-06-16 00:36:39 +0000
committerSteve Huston <shuston@riverace.com>2002-06-16 00:36:39 +0000
commit7196cf9462f4e555f4d108aa4b7197d97270eb5b (patch)
treebc38640fea48d45a7a12fa7207aaaa6be6e02370 /ace/Asynch_Connector.h
parentdae4a35c3c527ea3df1496083706d9507eef8ed7 (diff)
downloadATCD-7196cf9462f4e555f4d108aa4b7197d97270eb5b.tar.gz
ChangeLogTag:Sat Jun 15 20:30:41 2002 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ace/Asynch_Connector.h')
-rw-r--r--ace/Asynch_Connector.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/ace/Asynch_Connector.h b/ace/Asynch_Connector.h
index 55bda8694e0..9b4acd67b51 100644
--- a/ace/Asynch_Connector.h
+++ b/ace/Asynch_Connector.h
@@ -56,7 +56,7 @@ public:
*/
virtual int open (int pass_addresses = 0,
ACE_Proactor *proactor = 0,
- int validate_new_connection = 0);
+ int validate_new_connection = 1);
/// This initiates a new asynchronous connect
virtual int connect (const ACE_INET_Addr &remote_sap,
@@ -76,12 +76,37 @@ public:
*/
virtual int cancel (void);
+
/**
- * Template method for address validation.
+ * Template method to validate peer before service is opened.
+ * This method is called when the connection attempt completes,
+ * whether it succeeded or failed, if the @a validate_connection
+ * argument to @c open() was non-zero or the @c validate_new_connection()
+ * method is called to turn this feature on. The default implementation
+ * returns 0. Users can (and probably should) reimplement this method
+ * to learn about the success or failure of the connection attempt.
+ * If the connection completed successfully, this method can be used to
+ * perform validation of the peer using it's address, running an
+ * authentication procedure (such as SSL) or anything else necessary or
+ * desireable. The return value from this method determines whether or
+ * not ACE will continue opening the service or abort the connection.
+ *
+ * @arg result Result of the connection acceptance. Use
+ * result.success() to determine success or failure of
+ * the connection attempt.
+ * @arg remote Peer's address. If the connection failed, this object
+ * is undefined.
+ * @arg local Local address connection was completed from. If the
+ * connection failed, this object is undefined.
*
- * Default implemenation always validates the remote address.
+ * @retval -1 ACE_Asynch_Connector will close the connection, and
+ * the service will not be opened.
+ * @retval 0 Service opening will proceeed.
+ * @return Return value is ignored if the connection attempt failed.
*/
- virtual int validate_new_connection (const ACE_INET_Addr &remote_address);
+ virtual int validate_connection (const ACE_Asynch_Connect::Result& result,
+ const ACE_INET_Addr &remote,
+ const ACE_INET_Addr& local);
//
// These are low level tweaking methods