diff --git a/FunctionalClientTest/maindialog.cpp b/FunctionalClientTest/maindialog.cpp index 82cf8bb4eff193406815eb416f83879055ba71c9..465bc5c8cff34de58adc7c1690b6c2b78821469e 100644 --- a/FunctionalClientTest/maindialog.cpp +++ b/FunctionalClientTest/maindialog.cpp @@ -14,6 +14,7 @@ MainDialog::MainDialog(QWidget *parent) : { ui->setupUi(this); m_bLogedIn = false; + m_bBox = false; m_bUUIDGot = false; nTimer = startTimer(100); ui->listView_msg->setModel(&model); @@ -667,6 +668,7 @@ int MainDialog::deal_current_message_block() if (pApp->MsgUnion.msg_HostLogonRsp.DoneCode==0) { m_bLogedIn = true; + m_bBox = true; QMessageBox::information(this,tr("Succeed!"),tr("Log in succeed!")); } else @@ -700,6 +702,7 @@ int MainDialog::deal_current_message_block() if (pApp->MsgUnion.msg_ClientLoginRsp.DoneCode==0) { m_bLogedIn = true; + m_bBox = false; QMessageBox::information(this,tr("Succeed!"),tr("Log in succeed!")); } else @@ -807,8 +810,10 @@ void MainDialog::on_pushButton_sendToClient_clicked() pMsg->Priority = 1; pMsg->Reserved1 = 0; - pMsg->source_id = (quint32)((quint64)(ui->lineEdit_boxid->text().toUInt()) & 0xffffffff ); - + if (m_bBox==true) + pMsg->source_id = (quint32)((quint64)(ui->lineEdit_boxid->text().toUInt()) & 0xffffffff ); + else + pMsg->source_id = (quint32)((quint64)(ui->lineEdit_userid->text().toUInt()) & 0xffffffff ); pMsg->destin_id = (quint32)((quint64)(ui->lineEdit_client_uuid->text().toUInt()) & 0xffffffff );; pMsg->data_length = arrMsg.size(); diff --git a/FunctionalClientTest/maindialog.h b/FunctionalClientTest/maindialog.h index d150c2cc8303fb12605d0dc9e1384cbe8555632b..21599f9b335abbd70381b32c41914c97c19066be 100644 --- a/FunctionalClientTest/maindialog.h +++ b/FunctionalClientTest/maindialog.h @@ -29,6 +29,7 @@ private: void saveIni(); bool m_bLogedIn; + bool m_bBox; bool m_bUUIDGot ; //!Message Dealers diff --git a/FunctionalClientTest/maindialog.ui b/FunctionalClientTest/maindialog.ui index 7642282b3254a7a1f251f5d1eda7417b07097d46..b3d86775485c676f31644da5ce682bd37a325576 100644 --- a/FunctionalClientTest/maindialog.ui +++ b/FunctionalClientTest/maindialog.ui @@ -101,7 +101,7 @@ QTabWidget::Triangular - 1 + 0 diff --git a/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp b/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp index bab2ab2a04d8d0a9f2c0ed0aaea8cd3f73a02a7e..fb4016c8fb3e034da2213345466b7f8cfd8a14fe 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp +++ b/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp @@ -330,10 +330,9 @@ namespace SmartLink{ this->m_pThreadEngine->SendDataToClient(pAppLayer->sock(),msg); bres = true; } - m_hash_mutex.unlock(); - } m_hash_mutex.unlock(); + emit evt_Message(this,tr("Recieved remote user-data to uuid:%1,DATA:%2").arg(uuid).arg(QString("HEX")+QString(msg.toHex()))); return bres; } @@ -363,6 +362,7 @@ namespace SmartLink{ { st_cross_svr_node * pNode = new st_cross_svr_node(pTerm,psock,parent); pNode->setClientTable(this); + //connect (pNode,&st_cross_svr_node::evt_SendToNode,this,&st_client_table::SendToNode,Qt::QueuedConnection); return pNode; } //reg new uuids in m_hash_remoteClient2SvrName diff --git a/ZoomPipeline_FuncSvr/smartlink/st_client_table.h b/ZoomPipeline_FuncSvr/smartlink/st_client_table.h index 5b456c8af8ef4433e05b04accf079b451806ca34..c19c7ff9e8a84632e98cd0a0af498b703e02b7a0 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_client_table.h +++ b/ZoomPipeline_FuncSvr/smartlink/st_client_table.h @@ -114,7 +114,7 @@ namespace SmartLink{ void on_evt_RemoteData_recieved(const QString &/*svrHandle*/,const QByteArray & /*svrHandle*/ ); //a block of data has been successfuly sent void on_evt_RemoteData_transferred(QObject * /*svrHandle*/,qint64 /*bytes sent*/); - + public slots: //send msg to uuid bool SendToNode(quint32 uuid, const QByteArray & msg); diff --git a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.cpp b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.cpp index 61d1d2c28de7672054b78d1e60e715d6853dc4ab..df60d0e92fcf4a27e6901a1e4987012f77f80f4d 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.cpp +++ b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.cpp @@ -91,12 +91,18 @@ namespace SmartLink{ if (m_destin_uuid == 0xffffffff) return false; //Send to Client -// //Transfer -// if (false==m_pClientTable->SendToNode(this->m_destin_uuid , m_currStBlock)) -// { - -// } - + //emit evt_SendToNode(this->m_destin_uuid , m_currStBlock); + //Transfer + bool res = false; + if (m_currStMegSize == m_currStBlock.size()) + { + STCROSSSVR_MSG * pMsg = (STCROSSSVR_MSG *) m_currStBlock.constData(); + SMARTLINK_MSG * pSmMsg = (SMARTLINK_MSG *) pMsg->payload.data; + QByteArray blocks((const char *)pSmMsg,m_currStMegSize - sizeof(STCROSSSVR_MSG::tag_msgHearder)); + res=m_pClientTable->SendToNode(this->m_destin_uuid , blocks); + } + else + res=m_pClientTable->SendToNode(this->m_destin_uuid , m_currStBlock); } delCurrBlock = true; break; diff --git a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h index cae5f765397865b1d89ffa7dfb69ce06cbd827c8..54ff59e30ac05568965afaa8dd9deef0bd04fdce 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h +++ b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h @@ -26,6 +26,8 @@ namespace SmartLink{ //current Header STCROSSSVR_MSG::tag_msgHearder m_st_Header; quint32 m_destin_uuid; + signals: + void evt_SendToNode(quint32 uuid, const QByteArray & msg); }; } #endif // ST_CROSS_SVR_NODE_H