exit
streamIN.readLine();
QFile in; QTextStream streamIN(&in); in.open(IO_ReadOnly,stdin);
if (!in.atEnd()) { serverCommand = streamIN.readLine(); QString serCom = serverCommand.upper(); if (serCom == "EXIT") break; }
(in.atEnd())
C++ (Qt)std::string msg;std::string quitCommand = "Exit";while (true) { std::getline(std::cin, msg); if (msg == quitCommand) { quit(); return 0; } sendEvent(msg); }
C++ (Qt)int ReadyKey( void ){ int i; fd_set fds; struct timeval tv; FD_ZERO(&fds); FD_SET(STDIN_FILENO, &fds); tv.tv_sec = tv.tv_usec = 0; i = select(1, &fds, NULL, NULL, &tv); if (i == -1) return false; return FD_ISSET(STDIN_FILENO, &fds) != 0;} // использованиеif (ReadyKey() && getchar() == 27) // нажал Cancel?