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

Method read_wakeup

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

Source from the content-addressed store, hash-verified

143 }
144
145 bool read_wakeup()
146 {
147 // ȡ��֮ǰͨ�� setup_hook ע��� SSL IO���
148 acl::sslbase_io* hook = (acl::sslbase_io*) client_->get_hook();
149
150 if (hook == NULL) {
151 std::cout << "get hook error"<< std::endl;
152 return false;
153 }
154
155 printf(">>>%s: begin handshake\n", __FUNCTION__);
156 // ���Խ��� SSL ����
157 if (!hook->handshake()) {
158 logger_error("%s: ssl handshake failed", __FUNCTION__);
159 return false;
160 }
161
162 printf(">>>%s: end handshake\r\n", __FUNCTION__);
163 // SSL ���ֻ�δ��ɣ��ȴ��������ٴα�����
164 if (!hook->handshake_ok()) {
165 printf(">>>%s: not handshake ok\r\n", __FUNCTION__);
166 return true;
167 }
168
169 // ��� SSL �����Ѿ��ɹ�����ʼ������
170
171 printf(">>>%s: ssl handshake ok\r\n", __FUNCTION__);
172
173 // �� reactor ģʽתΪ proactor ģʽ���Ӷ�ȡ��
174 // read_wakeup �ص�����
175 client_->disable_read();
176
177 // ��ʼ�����˵Ķ�д����
178 return begin_run();
179 }
180
181 /**
182 * �����麯��, ���첽���ӳɹ�����ô˺���

Callers

nothing calls this directly

Calls 3

disable_readMethod · 0.80
get_hookMethod · 0.45
handshakeMethod · 0.45

Tested by

no test coverage detected