| 171 | }; |
| 172 | |
| 173 | static bool connect_ssl_server(IO_CTX* ctx, int id) |
| 174 | { |
| 175 | // ��ʼ�첽����Զ�̷����� |
| 176 | ssl_aio_stream* stream = ssl_aio_stream::open(ctx->handle, |
| 177 | ctx->addr, ctx->connect_timeout, true); |
| 178 | if (stream == NULL) |
| 179 | { |
| 180 | std::cout << "connect " << ctx->addr << " error!" << std::endl; |
| 181 | std::cout << "stoping ..." << std::endl; |
| 182 | if (id == 0) |
| 183 | ctx->handle->stop(); |
| 184 | return (false); |
| 185 | } |
| 186 | |
| 187 | // �������Ӻ�Ļص������� |
| 188 | ssl_io_callback* callback = new ssl_io_callback(ctx, stream, id); |
| 189 | |
| 190 | // �������ӳɹ��Ļص������� |
| 191 | stream->add_open_callback(callback); |
| 192 | |
| 193 | // ��������ʧ�ܺ�ص������� |
| 194 | stream->add_close_callback(callback); |
| 195 | |
| 196 | // �������ӳ�ʱ�Ļص������� |
| 197 | stream->add_timeout_callback(callback); |
| 198 | return (true); |
| 199 | } |
| 200 | |
| 201 | static void usage(const char* procname) |
| 202 | { |
no test coverage detected
searching dependent graphs…