diff --git a/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp b/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp index fb42a66c63d701b1795eb8521b1aa2cd585e189a..3a82bf73c8d8782fe29d00ca213d115dd7250568 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp +++ b/ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp @@ -384,5 +384,27 @@ namespace SmartLink{ m_mutex_cross_svr_map.unlock(); emit evt_Message(this,tr("Removed remote %1 client uuid(s) from svr ").arg(nUUIDs) + svrname); } + void st_client_table::cross_svr_send_data(const QString & svrname,const QByteArray & arr) + { + int nMsgLen = sizeof(STCROSSSVR_MSG::tag_msgHearder); + QByteArray array(nMsgLen,0); + STCROSSSVR_MSG * pMsg = (STCROSSSVR_MSG *) array.data(); + pMsg->header.Mark = 0x4567; + pMsg->header.version = 1; + pMsg->header.messageLen = arr.size(); + pMsg->header.mesageType = 0x03; + array.append(arr); + m_pCluster->SendDataToRemoteServer(svrname,array); + } + + QString st_client_table::cross_svr_find_uuid(quint32 uuid) + { + QString svr = ""; + m_mutex_cross_svr_map.lock(); + if (m_hash_remoteClient2SvrName.find(uuid)!=m_hash_remoteClient2SvrName.end()) + svr = m_hash_remoteClient2SvrName[uuid]; + m_mutex_cross_svr_map.unlock(); + return svr; + } } diff --git a/ZoomPipeline_FuncSvr/smartlink/st_client_table.h b/ZoomPipeline_FuncSvr/smartlink/st_client_table.h index 3975c53f5f2afba7ffbd5e2e11f2f2099c3e0f69..b7c1a582271893ac4f1508f722b0ba2be1ccf52d 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_client_table.h +++ b/ZoomPipeline_FuncSvr/smartlink/st_client_table.h @@ -52,6 +52,10 @@ namespace SmartLink{ void cross_svr_del_uuids(const QString & svrname,quint32 * pUUIDs , int nUUIDs); //Tell remote servers of uuid-change void broadcast_client_uuid(quint32 uuid, bool bActive); + //Trans user Data + void cross_svr_send_data(const QString & svrname,const QByteArray & arr); + //Server Name find + QString cross_svr_find_uuid(quint32 uuid); protected: //This list hold dead nodes that still in task queue,avoiding crash diff --git a/ZoomPipeline_FuncSvr/smartlink/st_clientnode_applayer.cpp b/ZoomPipeline_FuncSvr/smartlink/st_clientnode_applayer.cpp index 2a242c2d2480e652b4585afe119236070668542c..e41c6affbe393987fc4fe980e484791871d2a1f1 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_clientnode_applayer.cpp +++ b/ZoomPipeline_FuncSvr/smartlink/st_clientnode_applayer.cpp @@ -209,12 +209,14 @@ namespace SmartLink{ st_clientNode_baseTrans * destin_node = m_pClientTable->clientNodeFromUUID(m_currentHeader.destin_id); if (destin_node==NULL) { - //need further dev, insert into db, or catched on disk. - //destin client is un-reachable, or in another function server. //need server-to-server channels to re-post this message. - emit evt_Message(this,tr("Destin ID ") + QString("%1").arg(m_currentHeader.destin_id) + tr(" is not currently logged in.")); + QString svr = m_pClientTable->cross_svr_find_uuid(m_currentHeader.destin_id); + if (svr.length()<=0) + emit evt_Message(this,tr("Destin ID ") + QString("%1").arg(m_currentHeader.destin_id) + tr(" is not currently logged in.")); + else + m_pClientTable->cross_svr_send_data(svr,m_currentBlock); + - //Do Nothing } else { diff --git a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h index e6cd3a674101fa54c58f3e1433e05879e73455da..46ae5ff3ed57abdb623f08a4ce6032e611c1cb5a 100644 --- a/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h +++ b/ZoomPipeline_FuncSvr/smartlink/st_cross_svr_node.h @@ -18,7 +18,7 @@ namespace SmartLink{ protected: st_client_table * m_pClientTable; //Current Message Offset, according to m_currentHeader - int m_currStMegSize; + quint32 m_currStMegSize; //Current un-procssed message block.for large blocks, //this array will be re-setted as soon as some part of data has been //dealed, eg, send a 200MB block, the 200MB data will be splitted into pieces