* �����麯��, ���첽���ӳɹ�����ô˺��� * @return {bool} ���ظ������� true ��ʾ�����������ʾ��Ҫ�ر��첽�� */
| 132 | * @return {bool} ���ظ������� true ��ʾ�����������ʾ��Ҫ�ر��첽�� |
| 133 | */ |
| 134 | bool open_callback(void) |
| 135 | { |
| 136 | // ���ӳɹ�������IO��д�ص����� |
| 137 | client_->add_read_callback(this); |
| 138 | client_->add_write_callback(this); |
| 139 | ctx_->nopen_total++; |
| 140 | |
| 141 | std::cout << "opend ok, nopen: " << ctx_->nopen_total |
| 142 | << std::endl; |
| 143 | |
| 144 | acl::assert_(id_ > 0); |
| 145 | if (ctx_->nopen_total < ctx_->nopen_limit) { |
| 146 | // ��ʼ������һ�����ӹ��� |
| 147 | if (!connect_server(ctx_, id_ + 1)) { |
| 148 | std::cout << "connect error!" |
| 149 | << acl::last_serror() << std::endl; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | // �첽�ӷ�������ȡһ������ |
| 154 | client_->gets(ctx_->read_timeout, false); |
| 155 | |
| 156 | // ��ʾ�����첽���� |
| 157 | return true; |
| 158 | } |
| 159 | |
| 160 | private: |
| 161 | acl::aio_socket_stream* client_; |
nothing calls this directly
no test coverage detected