diff --git a/examples/qqtclientexample/mainwindow.cpp b/examples/qqtclientexample/mainwindow.cpp index 03dd05a2..9e568503 100644 --- a/examples/qqtclientexample/mainwindow.cpp +++ b/examples/qqtclientexample/mainwindow.cpp @@ -14,7 +14,8 @@ MainWindow::MainWindow ( QWidget* parent ) : // p = QQtClientConnectionInstance ( this ); connect ( p, SIGNAL ( signalServerSay ( QString ) ), - this, SLOT ( on_recv_say_hello ( QString ) ) ); + this, SLOT ( on_recv_say_hello ( QString ) ), + Qt::QueuedConnection ); //QQtClient2Protocol* p0 = QQtClient2ConnectionInstance ( this ); //p0->sendCommand1(); diff --git a/examples/qqtclientexample/qqtclientprotocol.h b/examples/qqtclientexample/qqtclientprotocol.h index 4bf70802..3f68376c 100644 --- a/examples/qqtclientexample/qqtclientprotocol.h +++ b/examples/qqtclientexample/qqtclientprotocol.h @@ -149,7 +149,6 @@ protected: } virtual quint16 splitter ( const QByteArray& l ) override { //stream - pline() << l[0] << l[1] << l[2] << l[3] << l[4] << l[5] << l[6] << l[7]; for ( int i = 0; i < l.size(); i++ ) { pline() << l[i]; } @@ -157,7 +156,6 @@ protected: QByteArray s0 = l.left ( 3 ); quint8 start = 0; quint16 size = 0; - pline() << s0[0] << s0[1] << s0[2]; s0 >> start; s0 >> size; diff --git a/src/linux_cd_path.sh b/src/linux_cd_path.sh old mode 100755 new mode 100644 diff --git a/src/linux_cp_files.sh b/src/linux_cp_files.sh old mode 100755 new mode 100644 diff --git a/src/linux_cur_path.sh b/src/linux_cur_path.sh old mode 100755 new mode 100644 diff --git a/src/network/qqttcpclient.cpp b/src/network/qqttcpclient.cpp index 8045c474..7ed9059f 100644 --- a/src/network/qqttcpclient.cpp +++ b/src/network/qqttcpclient.cpp @@ -143,10 +143,6 @@ void QQtTcpClient::socketStateChanged ( QAbstractSocket::SocketState eSocketStat case QAbstractSocket::UnconnectedState: { - eConType++; - QSettings set; - set.setValue ( "Network/eConType", eConType ); - set.sync(); break; } default: @@ -173,8 +169,19 @@ void QQtTcpClient::socketErrorOccured ( QAbstractSocket::SocketError e ) case QAbstractSocket::HostNotFoundError: default: + { + QSettings set; + int contype = set.value ( "Network/eConType", 0 ).toInt(); + contype++; + contype = contype % m_serverIP.size(); + set.setValue ( "Network/eConType", contype ); + set.sync(); + + eConType = contype; + emit signalConnectFail(); - break; + } + break; } } @@ -212,9 +219,12 @@ void QQtTcpClient::updateProgress ( qint64 bytes ) void QQtTcpClient::connectToSingelHost() { + //int contype = eConType % m_serverIP.size(); + QSettings set; int contype = set.value ( "Network/eConType", 0 ).toInt(); - //int contype = eConType % m_serverIP.size(); + contype = contype % m_serverIP.size(); + QString ip = m_serverIP.at ( contype ); connectToHost ( QHostAddress ( ip ), m_PORT );