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

Function connect_ssl_server

lib_acl_cpp/samples/aio/ssl_aio_client/main.cpp:173–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171};
172
173static 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
201static void usage(const char* procname)
202{

Callers 2

open_callbackMethod · 0.85
mainFunction · 0.85

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…