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

Function connect_server

lib_acl_cpp/samples/aio/aio_client_ssl/main.cpp:274–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272};
273
274static bool connect_server(IO_CTX* ctx, int id)
275{
276 // ��ʼ�첽����Զ�̷�����
277 acl::aio_socket_stream* stream = acl::aio_socket_stream::open
278 (ctx->handle, ctx->addr, ctx->connect_timeout);
279 if (stream == NULL) {
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 // �������Ӻ�Ļص�������
289 client_io_callback* callback = new client_io_callback(ctx, stream, id);
290
291 // �������ӳɹ��Ļص�������
292 stream->add_open_callback(callback);
293
294 // ��������ʧ�ܺ�ص�������
295 stream->add_close_callback(callback);
296
297 // �������ӳ�ʱ�Ļص�������
298 stream->add_timeout_callback(callback);
299 return true;
300}
301
302static void usage(const char* procname)
303{

Callers 2

open_callbackMethod · 0.70
mainFunction · 0.70

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…