提交 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) :
{
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();
......
......@@ -29,6 +29,7 @@ private:
void saveIni();
bool m_bLogedIn;
bool m_bBox;
bool m_bUUIDGot ;
//!Message Dealers
......
......@@ -101,7 +101,7 @@
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册