qabstractsocket

QTcpSocket connecting results in UnknownSocketError with errorString “UnknownError”

半腔热情 提交于 2019-12-12 03:49:03
问题 Problem I am unable to get any further information regarding this error: QAbstractSocket::UnknownSocketError The QT QAbstractSocket::SocketError provides only a basic explanation that some error has occurred An unidentified error occurred. enum value = -1 Calling QTcpSocket::errorString() provides this: "Unknown error" There is one question regarding this here on SO but provides no real solution to solving the issue (and what was suggested I have done) I have absoltely no idea how to further

Get the ping from a remote target with Qt (Windows/Linux)

半世苍凉 提交于 2019-12-05 18:49:39
问题 Currently I use this code for retrieving the ping of a target system. However it works so far only under linux and it is likely dependent on the locale settings. To add support for windows will be likely even more complicated. Is there an easy way or library to get the ping of a target system? I mainly work with Qt, so it would be ideal if I could work with QSockets. #ifndef _WIN32 QProcess ping; ping.start("ping", QStringList() << "-c 1" << m_sHostName); if(ping.waitForFinished(250) ) {

Get the ping from a remote target with Qt (Windows/Linux)

拜拜、爱过 提交于 2019-12-04 02:49:41
Currently I use this code for retrieving the ping of a target system. However it works so far only under linux and it is likely dependent on the locale settings. To add support for windows will be likely even more complicated. Is there an easy way or library to get the ping of a target system? I mainly work with Qt, so it would be ideal if I could work with QSockets. #ifndef _WIN32 QProcess ping; ping.start("ping", QStringList() << "-c 1" << m_sHostName); if(ping.waitForFinished(250) ) { while(ping.canReadLine()) { QString line = ping.readLine(); if(line.contains("time=")) { int iStart = line