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

Function connect_server

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

Source from the content-addressed store, hash-verified

271};
272
273static bool connect_server(acl::sslbase_conf* ssl_conf, IO_CTX* ctx, int id)
274{
275 // ��ʼ�첽����Զ�̷�����
276 acl::aio_socket_stream* stream = acl::aio_socket_stream::open(
277 ctx->handle, ctx->addr, ctx->connect_timeout);
278 if (stream == NULL)
279 {
280 std::cout << "connect " << ctx->addr << " error!" << std::endl;
281 std::cout << "stoping ..." << std::endl;
282 if (id == 0) {
283 ctx->handle->stop();
284 }
285 return false;
286 }
287
288 acl_non_blocking(stream->sock_handle(), ACL_BLOCKING);
289
290 // �������Ӻ�Ļص�������
291 client_io_callback* callback = new
292 client_io_callback(stream, ssl_conf, ctx, id);
293
294 // �������ӳɹ��Ļص�������
295 stream->add_open_callback(callback);
296
297 // ��������ʧ�ܺ�ص�������
298 stream->add_close_callback(callback);
299
300 // �������ӳ�ʱ�Ļص�������
301 stream->add_timeout_callback(callback);
302
303 return true;
304}
305
306static void usage(const char* procname)
307{

Callers 9

open_callbackMethod · 0.70
mainFunction · 0.70
open_callbackMethod · 0.50
OnBnClickedConnectMethod · 0.50
http_requestMethod · 0.50
http_requestMethod · 0.50
runMethod · 0.50
runMethod · 0.50

Calls 7

openFunction · 0.85
acl_non_blockingFunction · 0.85
add_open_callbackMethod · 0.80
add_close_callbackMethod · 0.80
add_timeout_callbackMethod · 0.80
stopMethod · 0.45
sock_handleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…