void* launchTcpServer(void* param) { IClient *clientTCP = new ClientTCP(); MenuWindow *win = reinterpret_cast<MenuWindow*>(param); clientTCP->setMenuWindow(win); win->setTcpClient(clientTCP); try { clientTCP->run(win->getNetEvent()->getIp(), 4242); } catch (std::exception const& e) { std::cerr << e.what() << std::endl; } win->getMutex()->lock(); win->setConnected(false); win->getMutex()->unlock(); return (NULL); }