| 96 | } |
| 97 | |
| 98 | ssl_aio_stream* ssl_aio_stream::open(aio_handle* handle, |
| 99 | const char* addr, int timeout, bool use_ssl /* = true */) |
| 100 | { |
| 101 | acl_assert(handle); |
| 102 | |
| 103 | ACL_ASTREAM* astream = |
| 104 | acl_aio_connect(handle->get_handle(), addr, timeout); |
| 105 | if (astream == NULL) |
| 106 | return NULL; |
| 107 | |
| 108 | ssl_aio_stream* stream = new ssl_aio_stream(handle, astream, false); |
| 109 | |
| 110 | // ���û���� hook_error ���� handle �������첽������, |
| 111 | // ͬʱ hook �رռ���ʱ�ص����� |
| 112 | stream->hook_error(); |
| 113 | // hook ���ӳɹ��Ļص����� |
| 114 | stream->hook_open(); |
| 115 | |
| 116 | // �����ʹ��SSL����ע�᱾�����Ϊ���ӳɹ���ĵ�һ���ص����� |
| 117 | if (use_ssl) |
| 118 | stream->add_open_callback(stream); |
| 119 | |
| 120 | return stream; |
| 121 | } |
| 122 | |
| 123 | bool ssl_aio_stream::open_ssl(bool on) |
| 124 | { |
no test coverage detected