| 171 | // ---------------------------------------------------------------------------------------- |
| 172 | |
| 173 | void server:: |
| 174 | start_async ( |
| 175 | ) |
| 176 | { |
| 177 | auto_mutex lock(running_mutex); |
| 178 | if (running) |
| 179 | return; |
| 180 | |
| 181 | // Any exceptions likely to be thrown by the server are going to be |
| 182 | // thrown when trying to bind the port. So calling this here rather |
| 183 | // than in the thread we are about to make will cause start_async() |
| 184 | // to report errors back to the user in a very straight forward way. |
| 185 | open_listening_socket(); |
| 186 | |
| 187 | async_start_thread.reset(new thread_function(make_mfp(*this,&server::start_async_helper))); |
| 188 | } |
| 189 | |
| 190 | // ---------------------------------------------------------------------------------------- |
| 191 | |