| 130 | ////////////////////////////////////////////////////////////////////////////// |
| 131 | |
| 132 | static 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 |
no test coverage detected
searching dependent graphs…