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

Method read_wakeup

lib_acl_cpp/samples/ssl/aio_server/main.cpp:53–83  ·  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

51 * @return {bool} �ú������� false ֪ͨ�첽����رո��첽��
52 */
53 bool read_wakeup()
54 {
55 acl::sslbase_io* hook = (acl::sslbase_io*) client_->get_hook();
56 if (hook == NULL) {
57 // �� SSL ģʽ���첽��ȡ����
58 //client_->read(__timeout);
59 client_->gets(__timeout, false);
60 return true;
61 }
62
63 // ���Խ��� SSL ����
64 if (!hook->handshake()) {
65 printf("%s: ssl handshake failed\r\n", __FUNCTION__);
66 return false;
67 }
68
69 // ��� SSL �����Ѿ��ɹ�����ʼ���ж�����
70 if (hook->handshake_ok()) {
71 // �� reactor ģʽתΪ proactor ģʽ���Ӷ�ȡ��
72 // read_wakeup �ص�����
73 client_->disable_read();
74
75 // �첽��ȡ���ݣ�����ص� read_callback
76 //client_->read(__timeout);
77 client_->gets(__timeout, false);
78 return true;
79 }
80
81 // SSL ���ֻ�δ��ɣ��ȴ��������ٴα�����
82 return true;
83 }
84
85 /**
86 * ʵ�ָ����е��麯�����ͻ������Ķ��ɹ��ص�����

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