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

Method close_callback

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

* �����麯��, �����첽���ر�ʱ���ô˻ص����� */

Source from the content-addressed store, hash-verified

100 * �����麯��, �����첽���ر�ʱ���ô˻ص�����
101 */
102 void close_callback()
103 {
104 if (!client_->is_opened()) {
105 std::cout << "Id: " << id_ << " connect "
106 << ctx_->addr << " error: "
107 << acl::last_serror();
108
109 // ����ǵ�һ�����Ӿ�ʧ�ܣ����˳�
110 if (ctx_->nopen_total == 0) {
111 std::cout << ", first connect error, quit";
112 /* ����첽��������������Ϊ�˳�״̬ */
113 client_->get_handle().stop();
114 }
115 std::cout << std::endl;
116 delete this;
117 return;
118 }
119
120 /* ����첽�������ܼ�ص��첽������ */
121 int nleft = client_->get_handle().length();
122 if (ctx_->nopen_total == ctx_->nopen_limit && nleft == 1) {
123 std::cout << "Id: " << id_ << " stop now! nstream: "
124 << nleft << std::endl;
125 /* ����첽��������������Ϊ�˳�״̬ */
126 client_->get_handle().stop();
127 }
128
129 // �����ڴ˴�ɾ���ö�̬����Ļص�������Է�ֹ�ڴ�й¶
130 delete this;
131 }
132
133 /**
134 * �����麯�������첽����ʱʱ���ô˺���

Callers

nothing calls this directly

Calls 5

last_serrorFunction · 0.50
is_openedMethod · 0.45
stopMethod · 0.45
get_handleMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected