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

Method open_callback

lib_acl_cpp/samples/ssl/aio_client/main.cpp:185–209  ·  view source on GitHub ↗

* �����麯��, ���첽���ӳɹ�����ô˺��� * @return {bool} ���ظ������� true ��ʾ�����������ʾ��Ҫ�ر��첽�� */

Source from the content-addressed store, hash-verified

183 * @return {bool} ���ظ������� true ��ʾ�����������ʾ��Ҫ�ر��첽��
184 */
185 bool open_callback()
186 {
187 // ���ӳɹ�������IO��д�ص�����
188 client_->add_read_callback(this);
189 client_->add_write_callback(this);
190 ctx_->nopen_total++;
191
192 acl::assert_(id_ > 0);
193 if (ctx_->nopen_total < ctx_->nopen_limit) {
194 // ��ʼ������һ�����ӹ���
195 if (!connect_server(ssl_conf_, ctx_, id_ + 1)) {
196 std::cout << "connect error!" << std::endl;
197 }
198 }
199
200 // ���� SSL ��ʽ
201 if (ssl_conf_) {
202 return setup_ssl(*ssl_conf_);
203 }
204
205 // ��ʼ�����˵Ķ�д����
206 else {
207 return begin_run();
208 }
209 }
210
211private:
212 acl::aio_socket_stream* client_;

Callers

nothing calls this directly

Calls 5

assert_Function · 0.85
add_read_callbackMethod · 0.80
add_write_callbackMethod · 0.80
connect_serverFunction · 0.70
setup_sslFunction · 0.50

Tested by

no test coverage detected