MCPcopy Create free account
hub / github.com/acl-dev/acl / open

Method open

lib_acl_cpp/samples/aio/ssl_aio_client/ssl_aio_stream.cpp:98–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98ssl_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
123bool ssl_aio_stream::open_ssl(bool on)
124{

Callers 1

mainFunction · 0.45

Calls 3

acl_aio_connectFunction · 0.85
add_open_callbackMethod · 0.80
get_handleMethod · 0.45

Tested by

no test coverage detected