|
发表于 2009-10-21 23:46:03
|
显示全部楼层
会有返回结果的,会自动回调:
template<class HANDLER>
int ACE_Asynch_Connector< HANDLER >::validate_connection ( const ACE_Asynch_Connect::Result & result,
const ACE_INET_Addr & remote,
const ACE_INET_Addr & local
) [virtual]
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 validate_connection argument to open() was non-zero or the 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.
Parameters:
result Result of the connection acceptance. Use result.success() to determine success or failure of the connection attempt.
remote Peer's address. If the connection failed, this object is undefined.
local Local address connection was completed from. If the connection failed, this object is undefined.
Return values:
-1 ACE_Asynch_Connector will close the connection, and the service will not be opened.
0 Service opening will proceeed.
Returns:
Return value is ignored if the connection attempt failed. |
|