提交 7269ff5c 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

congratulations! a pin version, has been founded. this version, cross-svr...

congratulations! a pin version, has been founded. this version, cross-svr cluster has been realized.
上级 20752510
...@@ -14,6 +14,7 @@ MainDialog::MainDialog(QWidget *parent) : ...@@ -14,6 +14,7 @@ MainDialog::MainDialog(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
m_bLogedIn = false; m_bLogedIn = false;
m_bBox = false;
m_bUUIDGot = false; m_bUUIDGot = false;
nTimer = startTimer(100); nTimer = startTimer(100);
ui->listView_msg->setModel(&model); ui->listView_msg->setModel(&model);
...@@ -667,6 +668,7 @@ int MainDialog::deal_current_message_block() ...@@ -667,6 +668,7 @@ int MainDialog::deal_current_message_block()
if (pApp->MsgUnion.msg_HostLogonRsp.DoneCode==0) if (pApp->MsgUnion.msg_HostLogonRsp.DoneCode==0)
{ {
m_bLogedIn = true; m_bLogedIn = true;
m_bBox = true;
QMessageBox::information(this,tr("Succeed!"),tr("Log in succeed!")); QMessageBox::information(this,tr("Succeed!"),tr("Log in succeed!"));
} }
else else
...@@ -700,6 +702,7 @@ int MainDialog::deal_current_message_block() ...@@ -700,6 +702,7 @@ int MainDialog::deal_current_message_block()
if (pApp->MsgUnion.msg_ClientLoginRsp.DoneCode==0) if (pApp->MsgUnion.msg_ClientLoginRsp.DoneCode==0)
{ {
m_bLogedIn = true; m_bLogedIn = true;
m_bBox = false;
QMessageBox::information(this,tr("Succeed!"),tr("Log in succeed!")); QMessageBox::information(this,tr("Succeed!"),tr("Log in succeed!"));
} }
else else
...@@ -807,8 +810,10 @@ void MainDialog::on_pushButton_sendToClient_clicked() ...@@ -807,8 +810,10 @@ void MainDialog::on_pushButton_sendToClient_clicked()
pMsg->Priority = 1; pMsg->Priority = 1;
pMsg->Reserved1 = 0; 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->destin_id = (quint32)((quint64)(ui->lineEdit_client_uuid->text().toUInt()) & 0xffffffff );;
pMsg->data_length = arrMsg.size(); pMsg->data_length = arrMsg.size();
......
...@@ -29,6 +29,7 @@ private: ...@@ -29,6 +29,7 @@ private:
void saveIni(); void saveIni();
bool m_bLogedIn; bool m_bLogedIn;
bool m_bBox;
bool m_bUUIDGot ; bool m_bUUIDGot ;
//!Message Dealers //!Message Dealers
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<enum>QTabWidget::Triangular</enum> <enum>QTabWidget::Triangular</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
......
...@@ -330,10 +330,9 @@ namespace SmartLink{ ...@@ -330,10 +330,9 @@ namespace SmartLink{
this->m_pThreadEngine->SendDataToClient(pAppLayer->sock(),msg); this->m_pThreadEngine->SendDataToClient(pAppLayer->sock(),msg);
bres = true; bres = true;
} }
m_hash_mutex.unlock();
} }
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; return bres;
} }
...@@ -363,6 +362,7 @@ namespace SmartLink{ ...@@ -363,6 +362,7 @@ namespace SmartLink{
{ {
st_cross_svr_node * pNode = new st_cross_svr_node(pTerm,psock,parent); st_cross_svr_node * pNode = new st_cross_svr_node(pTerm,psock,parent);
pNode->setClientTable(this); pNode->setClientTable(this);
//connect (pNode,&st_cross_svr_node::evt_SendToNode,this,&st_client_table::SendToNode,Qt::QueuedConnection);
return pNode; return pNode;
} }
//reg new uuids in m_hash_remoteClient2SvrName //reg new uuids in m_hash_remoteClient2SvrName
......
...@@ -114,7 +114,7 @@ namespace SmartLink{ ...@@ -114,7 +114,7 @@ namespace SmartLink{
void on_evt_RemoteData_recieved(const QString &/*svrHandle*/,const QByteArray & /*svrHandle*/ ); void on_evt_RemoteData_recieved(const QString &/*svrHandle*/,const QByteArray & /*svrHandle*/ );
//a block of data has been successfuly sent //a block of data has been successfuly sent
void on_evt_RemoteData_transferred(QObject * /*svrHandle*/,qint64 /*bytes sent*/); void on_evt_RemoteData_transferred(QObject * /*svrHandle*/,qint64 /*bytes sent*/);
public slots:
//send msg to uuid //send msg to uuid
bool SendToNode(quint32 uuid, const QByteArray & msg); bool SendToNode(quint32 uuid, const QByteArray & msg);
......
...@@ -91,12 +91,18 @@ namespace SmartLink{ ...@@ -91,12 +91,18 @@ namespace SmartLink{
if (m_destin_uuid == 0xffffffff) if (m_destin_uuid == 0xffffffff)
return false; return false;
//Send to Client //Send to Client
// //Transfer //emit evt_SendToNode(this->m_destin_uuid , m_currStBlock);
// if (false==m_pClientTable->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; delCurrBlock = true;
break; break;
......
...@@ -26,6 +26,8 @@ namespace SmartLink{ ...@@ -26,6 +26,8 @@ namespace SmartLink{
//current Header //current Header
STCROSSSVR_MSG::tag_msgHearder m_st_Header; STCROSSSVR_MSG::tag_msgHearder m_st_Header;
quint32 m_destin_uuid; quint32 m_destin_uuid;
signals:
void evt_SendToNode(quint32 uuid, const QByteArray & msg);
}; };
} }
#endif // ST_CROSS_SVR_NODE_H #endif // ST_CROSS_SVR_NODE_H
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册