void fuction()
{
std::thread t1(server); }
code above, will occur that terminate called without an active exception
to solve the problem, modify code above as following code.
std::thread t1(server);
t1.detach(); // or t1.join }