c++ - QTcpSocket Telnet readyRead returns rubbish -
i used realterm telnet device , works when try use qtcpsocket access it, rubbish data socket readall(), whats wrong???
qobject::connect(&sock, signal(readyread()), this, slot(readyread())); void qtelnet::readyread() { qbytearray ba = sock.readall(); qdebug() << "read:" << ba ; }
output: "ÿýÿý ÿý#ÿý'"
update:
i called sock.connecttohost("192.168.80.17", 23); nothing else expected output follows:
linux 2.4.31 (ntp001) (26)
ntp001 login:
if you're sure sent data valid string, try convert them one:
qdebug() << "read:" << qstring(ba);
otherwise, reason behind "rubbish" may simple that's data connecting client sent.
Comments
Post a Comment