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

Function start_server

lib_acl_cpp/samples/ssl/server/main.cpp:132–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130//////////////////////////////////////////////////////////////////////////////
131
132static void start_server(const acl::string& addr, acl::sslbase_conf& ssl_conf,
133 int rw_timeout, int times) {
134
135 acl::server_socket ss;
136 if (!ss.open(addr)) {
137 printf("listen %s error %s\r\n", addr.c_str(), acl::last_serror());
138 return;
139 }
140
141 while (true) {
142 acl::socket_stream* conn = ss.accept();
143 if (conn == NULL) {
144 printf("accept error %s\r\n", acl::last_serror());
145 break;
146 }
147
148 conn->set_rw_timeout(rw_timeout);
149 acl::thread* thr = new echo_thread(ssl_conf, conn, times);
150 thr->set_detachable(true);
151 thr->start();
152 }
153}
154
155//////////////////////////////////////////////////////////////////////////////
156

Callers 1

mainFunction · 0.85

Calls 6

set_rw_timeoutMethod · 0.80
last_serrorFunction · 0.50
openMethod · 0.45
c_strMethod · 0.45
acceptMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…