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

Method read_wakeup

lib_acl_cpp/samples/aio/aio_server_ssl/main.cpp:123–151  ·  view source on GitHub ↗

* ���ص��麯�����ûص��������������� aio_istream ʵ���е� * gets/read �Ŀɶ������󱻵��ã����첽����ڲ��������������� * �ݶ�����ֱ�Ӵ��ݸ��û������� * @param data {char*} ���������ݵ�ָ���ַ * @param len {int} ���������ݳ���(> 0) * @return {bool} �ú������� false ֪ͨ�첽����رո��첽�� */

Source from the content-addressed store, hash-verified

121 * @return {bool} �ú������� false ֪ͨ�첽����رո��첽��
122 */
123 bool read_wakeup(void)
124 {
125 acl::polarssl_io* hook = (acl::polarssl_io*) client_->get_hook();
126 if (hook == NULL) {
127 // �� SSL ģʽ���첽��ȡһ������
128 client_->gets(__timeout, false);
129 return true;
130 }
131
132 // ���Խ��� SSL ����
133 if (!hook->handshake()) {
134 printf("ssl handshake failed\r\n");
135 return false;
136 }
137
138 // ��� SSL �����Ѿ��ɹ�����ʼ���ж�����
139 if (hook->handshake_ok()) {
140 // �� reactor ģʽתΪ proactor ģʽ���Ӷ�ȡ��
141 // read_wakeup �ص�����
142 client_->disable_read();
143
144 // �첽��ȡһ��
145 client_->gets(__timeout, false);
146 return true;
147 }
148
149 // SSL ���ֻ�δ��ɣ��ȴ��������ٴα�����
150 return true;
151 }
152
153 /**
154 * ʵ�ָ����е��麯�����ͻ������Ķ��ɹ��ص�����

Callers

nothing calls this directly

Calls 4

getsMethod · 0.80
disable_readMethod · 0.80
get_hookMethod · 0.45
handshakeMethod · 0.45

Tested by

no test coverage detected