diff --git a/ZoomPipeline_CtrlSvr/ZoomPipeline_CtrlSvr.pro b/ZoomPipeline_CtrlSvr/ZoomPipeline_CtrlSvr.pro deleted file mode 100644 index 81b789573abf61f145fdae3a3614f9b1464cf2d6..0000000000000000000000000000000000000000 --- a/ZoomPipeline_CtrlSvr/ZoomPipeline_CtrlSvr.pro +++ /dev/null @@ -1,20 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2014-02-22T21:50:54 -# -#------------------------------------------------- - -QT += core gui network sql - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = ZoomPipeline_CtrlSvr -TEMPLATE = app - - -SOURCES += main.cpp\ - maindialog.cpp - -HEADERS += maindialog.h - -FORMS += maindialog.ui diff --git a/ZoomPipeline_CtrlSvr/main.cpp b/ZoomPipeline_CtrlSvr/main.cpp deleted file mode 100644 index d9b0dba53e080c47b7f65b756b3c0a6b5db5f634..0000000000000000000000000000000000000000 --- a/ZoomPipeline_CtrlSvr/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "maindialog.h" -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainDialog w; - w.show(); - - return a.exec(); -} diff --git a/ZoomPipeline_CtrlSvr/maindialog.cpp b/ZoomPipeline_CtrlSvr/maindialog.cpp deleted file mode 100644 index e5fbc44dc82a974fc979e5d7dee0b85983b78ac2..0000000000000000000000000000000000000000 --- a/ZoomPipeline_CtrlSvr/maindialog.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "maindialog.h" -#include "ui_maindialog.h" - -MainDialog::MainDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::MainDialog) -{ - ui->setupUi(this); -} - -MainDialog::~MainDialog() -{ - delete ui; -} diff --git a/ZoomPipeline_CtrlSvr/maindialog.h b/ZoomPipeline_CtrlSvr/maindialog.h deleted file mode 100644 index 9c9a740a3baed142e914960ad66ff6e18d8d3138..0000000000000000000000000000000000000000 --- a/ZoomPipeline_CtrlSvr/maindialog.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef MAINDIALOG_H -#define MAINDIALOG_H - -#include - -namespace Ui { - class MainDialog; -} - -class MainDialog : public QDialog -{ - Q_OBJECT - -public: - explicit MainDialog(QWidget *parent = 0); - ~MainDialog(); - -private: - Ui::MainDialog *ui; -}; - -#endif // MAINDIALOG_H diff --git a/ZoomPipeline_CtrlSvr/maindialog.ui b/ZoomPipeline_CtrlSvr/maindialog.ui deleted file mode 100644 index 423125158281326214ed7fe68710ff82d5798ffb..0000000000000000000000000000000000000000 --- a/ZoomPipeline_CtrlSvr/maindialog.ui +++ /dev/null @@ -1,20 +0,0 @@ - - MainDialog - - - - 0 - 0 - 400 - 300 - - - - MainDialog - - - - - - - diff --git a/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp b/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp index 3a82bf73c8d8782fe29d00ca213d115dd7250568..bab2ab2a04d8d0a9f2c0ed0aaea8cd3f73a02a7e 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp +++ b/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp @@ -318,6 +318,24 @@ namespace SmartLink{ m_pCluster->SendDataToRemoteServer(svr,array); } } + bool st_client_table::SendToNode(quint32 uuid, const QByteArray & msg) + { + bool bres = false; + m_hash_mutex.lock(); + if (m_hash_uuid2node.contains(uuid)) + { + st_clientNode_baseTrans * pAppLayer = qobject_cast(m_hash_uuid2node[uuid]); + if (pAppLayer) + { + this->m_pThreadEngine->SendDataToClient(pAppLayer->sock(),msg); + bres = true; + } + m_hash_mutex.unlock(); + + } + m_hash_mutex.unlock(); + return bres; + } //this event indicates a client disconnected. void st_client_table::on_evt_NewSvrDisconnected(const QString & svrHandle) diff --git a/ZoomPipeline_FuncSvr/smartlink/st_client_table.h b/ZoomPipeline_FuncSvr/smartlink/st_client_table.h index b7c1a582271893ac4f1508f722b0ba2be1ccf52d..9752dedd2d39595a59dd02358144fce136f49257 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_client_table.h +++ b/ZoomPipeline_FuncSvr/smartlink/st_client_table.h @@ -30,7 +30,7 @@ namespace SmartLink{ bool regisitClientUUID(st_clientNode_baseTrans *); st_clientNode_baseTrans * clientNodeFromUUID(quint32); st_clientNode_baseTrans * clientNodeFromSocket(QObject *); - + bool SendToNode(quint32 uuid, const QByteArray & msg); //Heart beating and healthy void KickDeadClients(); int heartBeatingThrd(); diff --git a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.cpp b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.cpp index 12b3053d0089b604017c0bc19155857af7549d78..fedaae55514e6850ef444ea33df04b46b4c45b7a 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.cpp +++ b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.cpp @@ -1,12 +1,14 @@ #include "st_cross_svr_node.h" #include "../cluster/zp_clusterterm.h" #include "st_client_table.h" +#include "st_message.h" namespace SmartLink{ st_cross_svr_node::st_cross_svr_node(ZP_Cluster::zp_ClusterTerm * pTerm, QObject * psock,QObject *parent) :ZP_Cluster::zp_ClusterNode(pTerm,psock,parent) { m_currStMegSize = 0; + m_destin_uuid = 0xffffffff; } int st_cross_svr_node::st_bytesLeft() { @@ -47,6 +49,7 @@ namespace SmartLink{ { m_currStMegSize = 0; m_currStBlock.clear(); + m_destin_uuid = 0xffffffff; } } return ZP_Cluster::zp_ClusterNode::deal_user_data(array); @@ -75,6 +78,25 @@ namespace SmartLink{ } break; case 0x03: // data transfer + { + if (m_destin_uuid == 0xffffffff) + { + if (m_currStMegSize >= sizeof(STCROSSSVR_MSG::tag_msgHearder)+ sizeof(SMARTLINK_MSG)-1) + { + STCROSSSVR_MSG * pMsg = (STCROSSSVR_MSG *) m_currStBlock.constData(); + SMARTLINK_MSG * pSmMsg = (SMARTLINK_MSG *) pMsg->payload.data; + m_destin_uuid = pSmMsg->destin_id; + } + } + if (m_destin_uuid == 0xffffffff) + return false; + //Transfer + if (false==m_pClientTable->SendToNode(this->m_destin_uuid , m_currStBlock)) + { + + } + + } delCurrBlock = true; break; default: diff --git a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h index 46ae5ff3ed57abdb623f08a4ce6032e611c1cb5a..cae5f765397865b1d89ffa7dfb69ce06cbd827c8 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h +++ b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h @@ -25,6 +25,7 @@ namespace SmartLink{ QByteArray m_currStBlock; //current Header STCROSSSVR_MSG::tag_msgHearder m_st_Header; + quint32 m_destin_uuid; }; } #endif // ST_CROSS_SVR_NODE_H diff --git a/zoomPipeline.pro b/zoomPipeline.pro index aae2367a72bdfeae3c9aefcdba8b022232ef49c8..2958657b173070a32c53f44ab276955611165a70 100644 --- a/zoomPipeline.pro +++ b/zoomPipeline.pro @@ -1,6 +1,5 @@ TEMPLATE = subdirs -SUBDIRS += QTcpClientTest \ - ZoomPipeline_CtrlSvr +SUBDIRS += QTcpClientTest SUBDIRS += FunctionalClientTest SUBDIRS += ZoomPipeline_FuncSvr TRANSLATIONS += ./ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr_zh_CN.ts