void TelnetThread::run(){ QTcpSocket tcpSocket; if (!tcpSocket.setSocketDescriptor(socketDescriptor)) { emit error(tcpSocket.error()); return; } QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_0); QString text; text = "text"; out << text; tcpSocket.write(block); tcpSocket.waitForBytesWritten(10000); //tcpSocket.disconnectFromHost(); //tcpSocket.waitForDisconnected();}
QString text; text = "text"; out << text. toAscii();