Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蚂蚁寻路
zoompipeline
提交
4137a4c1
zoompipeline
项目概览
蚂蚁寻路
/
zoompipeline
与 Fork 源项目一致
Fork自
colorEagleStdio / zoompipeline
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
zoompipeline
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4137a4c1
编写于
3月 14, 2014
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Test cluster phyzical connection
上级
c01f7be1
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
250 addition
and
6 deletion
+250
-6
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr.pro
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr.pro
+7
-3
ZoomPipeline_FuncSvr/cluster/cross_svr_messages.h
ZoomPipeline_FuncSvr/cluster/cross_svr_messages.h
+45
-0
ZoomPipeline_FuncSvr/cluster/zp_clusterterm.cpp
ZoomPipeline_FuncSvr/cluster/zp_clusterterm.cpp
+3
-2
ZoomPipeline_FuncSvr/cluster/zp_clusterterm.h
ZoomPipeline_FuncSvr/cluster/zp_clusterterm.h
+1
-1
ZoomPipeline_FuncSvr/dialogaddressinput.cpp
ZoomPipeline_FuncSvr/dialogaddressinput.cpp
+29
-0
ZoomPipeline_FuncSvr/dialogaddressinput.h
ZoomPipeline_FuncSvr/dialogaddressinput.h
+24
-0
ZoomPipeline_FuncSvr/dialogaddressinput.ui
ZoomPipeline_FuncSvr/dialogaddressinput.ui
+92
-0
ZoomPipeline_FuncSvr/network/zp_net_threadpool.cpp
ZoomPipeline_FuncSvr/network/zp_net_threadpool.cpp
+2
-0
ZoomPipeline_FuncSvr/network/zp_nettransthread.cpp
ZoomPipeline_FuncSvr/network/zp_nettransthread.cpp
+3
-0
ZoomPipeline_FuncSvr/zpmainframe.cpp
ZoomPipeline_FuncSvr/zpmainframe.cpp
+16
-0
ZoomPipeline_FuncSvr/zpmainframe.h
ZoomPipeline_FuncSvr/zpmainframe.h
+1
-0
ZoomPipeline_FuncSvr/zpmainframe.ui
ZoomPipeline_FuncSvr/zpmainframe.ui
+27
-0
未找到文件。
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr.pro
浏览文件 @
4137a4c1
...
@@ -26,7 +26,8 @@ SOURCES += main.cpp\
...
@@ -26,7 +26,8 @@ SOURCES += main.cpp\
smartlink
/
st_clientnode_basetrans
.
cpp
\
smartlink
/
st_clientnode_basetrans
.
cpp
\
smartlink
/
st_clientnode_app_imp
.
cpp
\
smartlink
/
st_clientnode_app_imp
.
cpp
\
smartlink
/
st_clientnode_applayer
.
cpp
\
smartlink
/
st_clientnode_applayer
.
cpp
\
cluster
/
zp_clusterterm
.
cpp
cluster
/
zp_clusterterm
.
cpp
\
dialogaddressinput
.
cpp
HEADERS
+=
zpmainframe
.
h
\
HEADERS
+=
zpmainframe
.
h
\
network
/
zp_tcpserver
.
h
\
network
/
zp_tcpserver
.
h
\
...
@@ -42,9 +43,12 @@ HEADERS += zpmainframe.h \
...
@@ -42,9 +43,12 @@ HEADERS += zpmainframe.h \
smartlink
/
st_msg_applayer
.
h
\
smartlink
/
st_msg_applayer
.
h
\
smartlink
/
st_clientnode_basetrans
.
h
\
smartlink
/
st_clientnode_basetrans
.
h
\
smartlink
/
st_clientnode_applayer
.
h
\
smartlink
/
st_clientnode_applayer
.
h
\
cluster
/
zp_clusterterm
.
h
cluster
/
zp_clusterterm
.
h
\
cluster
/
cross_svr_messages
.
h
\
dialogaddressinput
.
h
FORMS
+=
zpmainframe
.
ui
FORMS
+=
zpmainframe
.
ui
\
dialogaddressinput
.
ui
RESOURCES
+=
\
RESOURCES
+=
\
resource
.
qrc
resource
.
qrc
...
...
ZoomPipeline_FuncSvr/cluster/cross_svr_messages.h
0 → 100644
浏览文件 @
4137a4c1
#ifndef CROSS_SVR_MESSAGES_H
#define CROSS_SVR_MESSAGES_H
namespace
ZP_Cluster
{
#pragma pack (push,1)
#if defined(__GNUC__)
#include <stdint.h>
typedef
struct
tag_cross_svr_message
{
struct
tag_header
{
__UINT16_TYPE__
Mark
;
//Always be "0x1234"
__UINT8_TYPE__
messagetype
;
}
hearder
;
union
uni_payload
{
struct
tag_plainData
{
__UINT16_TYPE__
data_length
;
__UINT8_TYPE__
data
[
1
];
}
plainData
;
}
payload
;
}
CROSS_SVR_MSG
;
#endif
#if defined(_MSC_VER)
typedef
struct
tag_cross_svr_message
{
struct
tag_header
{
unsigned
__int16
Mark
;
//Always be 0x1234
unsigned
__int8
messagetype
;
}
hearder
;
union
uni_payload
{
struct
tag_plainData
{
unsigned
__int16
data_length
;
unsigned
__int8
data
[
1
];
}
plainData
;
}
payload
;
}
CROSS_SVR_MSG
;
#endif
}
#endif // CROSS_SVR_MESSAGES_H
ZoomPipeline_FuncSvr/cluster/zp_clusterterm.cpp
浏览文件 @
4137a4c1
...
@@ -6,6 +6,7 @@ namespace ZP_Cluster{
...
@@ -6,6 +6,7 @@ namespace ZP_Cluster{
{
{
m_pClusterEng
=
new
ZPTaskEngine
::
zp_pipeline
(
this
);
m_pClusterEng
=
new
ZPTaskEngine
::
zp_pipeline
(
this
);
m_pClusterNet
=
new
ZPNetwork
::
zp_net_ThreadPool
(
8192
,
this
);
m_pClusterNet
=
new
ZPNetwork
::
zp_net_ThreadPool
(
8192
,
this
);
m_nPortPublish
=
0
;
}
}
void
zp_ClusterTerm
::
StartListen
(
const
QHostAddress
&
addr
,
int
nPort
)
void
zp_ClusterTerm
::
StartListen
(
const
QHostAddress
&
addr
,
int
nPort
)
...
@@ -13,9 +14,9 @@ namespace ZP_Cluster{
...
@@ -13,9 +14,9 @@ namespace ZP_Cluster{
m_pClusterNet
->
AddListeningAddress
(
m_strTermName
,
addr
,
nPort
,
false
);
m_pClusterNet
->
AddListeningAddress
(
m_strTermName
,
addr
,
nPort
,
false
);
}
}
bool
zp_ClusterTerm
::
JoinCluster
(
const
QHostAddress
&
addr
,
int
nPort
)
bool
zp_ClusterTerm
::
JoinCluster
(
const
QHostAddress
&
addr
,
int
nPort
,
bool
bSSL
)
{
{
return
m_pClusterNet
->
connectTo
(
addr
,
nPort
);
return
m_pClusterNet
->
connectTo
(
addr
,
nPort
,
bSSL
);
}
}
bool
zp_ClusterTerm
::
canExit
()
bool
zp_ClusterTerm
::
canExit
()
{
{
...
...
ZoomPipeline_FuncSvr/cluster/zp_clusterterm.h
浏览文件 @
4137a4c1
...
@@ -41,7 +41,7 @@ namespace ZP_Cluster{
...
@@ -41,7 +41,7 @@ namespace ZP_Cluster{
//!Join cluster, using existing term (addr:nPort)
//!Join cluster, using existing term (addr:nPort)
//!as soon as connection established, more existing terms will be sent to this term,
//!as soon as connection established, more existing terms will be sent to this term,
//!an p2p connection will start
//!an p2p connection will start
bool
JoinCluster
(
const
QHostAddress
&
addr
,
int
nPort
);
bool
JoinCluster
(
const
QHostAddress
&
addr
,
int
nPort
,
bool
bSSL
=
false
);
};
};
}
}
...
...
ZoomPipeline_FuncSvr/dialogaddressinput.cpp
0 → 100644
浏览文件 @
4137a4c1
#include "dialogaddressinput.h"
#include "ui_dialogaddressinput.h"
DialogAddressInput
::
DialogAddressInput
(
QWidget
*
parent
)
:
QDialog
(
parent
),
ui
(
new
Ui
::
DialogAddressInput
)
{
ui
->
setupUi
(
this
);
}
DialogAddressInput
::~
DialogAddressInput
()
{
delete
ui
;
}
void
DialogAddressInput
::
SetAddr
(
QString
addr
,
QString
port
)
{
ui
->
lineEdit_addr
->
setText
(
addr
);
ui
->
lineEdit_port
->
setText
(
port
);
}
QString
DialogAddressInput
::
addr
()
{
return
ui
->
lineEdit_addr
->
text
();
}
QString
DialogAddressInput
::
port
()
{
return
ui
->
lineEdit_port
->
text
();
}
ZoomPipeline_FuncSvr/dialogaddressinput.h
0 → 100644
浏览文件 @
4137a4c1
#ifndef DIALOGADDRESSINPUT_H
#define DIALOGADDRESSINPUT_H
#include <QDialog>
namespace
Ui
{
class
DialogAddressInput
;
}
class
DialogAddressInput
:
public
QDialog
{
Q_OBJECT
public:
explicit
DialogAddressInput
(
QWidget
*
parent
=
0
);
~
DialogAddressInput
();
void
SetAddr
(
QString
addr
,
QString
port
);
QString
addr
();
QString
port
();
private:
Ui
::
DialogAddressInput
*
ui
;
};
#endif // DIALOGADDRESSINPUT_H
ZoomPipeline_FuncSvr/dialogaddressinput.ui
0 → 100644
浏览文件 @
4137a4c1
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
DialogAddressInput
</class>
<widget
class=
"QDialog"
name=
"DialogAddressInput"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
174
</width>
<height>
97
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Dialog
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Addr
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_addr"
/>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<item>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Port
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_port"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>
buttonBox
</sender>
<signal>
accepted()
</signal>
<receiver>
DialogAddressInput
</receiver>
<slot>
accept()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
248
</x>
<y>
254
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
157
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
<connection>
<sender>
buttonBox
</sender>
<signal>
rejected()
</signal>
<receiver>
DialogAddressInput
</receiver>
<slot>
reject()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
316
</x>
<y>
260
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
286
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
</connections>
</ui>
ZoomPipeline_FuncSvr/network/zp_net_threadpool.cpp
浏览文件 @
4137a4c1
...
@@ -11,6 +11,8 @@ namespace ZPNetwork{
...
@@ -11,6 +11,8 @@ namespace ZPNetwork{
qRegisterMetaType
<
qintptr
>
(
"qintptr"
);
qRegisterMetaType
<
qintptr
>
(
"qintptr"
);
if
(
false
==
QMetaType
::
isRegistered
(
QMetaType
::
type
(
"QAbstractSocket::SocketError"
)))
if
(
false
==
QMetaType
::
isRegistered
(
QMetaType
::
type
(
"QAbstractSocket::SocketError"
)))
qRegisterMetaType
<
QAbstractSocket
::
SocketError
>
(
"QAbstractSocket::SocketError"
);
qRegisterMetaType
<
QAbstractSocket
::
SocketError
>
(
"QAbstractSocket::SocketError"
);
if
(
false
==
QMetaType
::
isRegistered
(
QMetaType
::
type
(
"QHostAddress"
)))
qRegisterMetaType
<
QHostAddress
>
(
"QHostAddress"
);
}
}
QStringList
zp_net_ThreadPool
::
ListenerNames
()
QStringList
zp_net_ThreadPool
::
ListenerNames
()
...
...
ZoomPipeline_FuncSvr/network/zp_nettransthread.cpp
浏览文件 @
4137a4c1
...
@@ -123,6 +123,9 @@ namespace ZPNetwork{
...
@@ -123,6 +123,9 @@ namespace ZPNetwork{
connect
(
sock_client
,
SIGNAL
(
error
(
QAbstractSocket
::
SocketError
)),
this
,
SLOT
(
displayError
(
QAbstractSocket
::
SocketError
)),
Qt
::
QueuedConnection
);
connect
(
sock_client
,
SIGNAL
(
error
(
QAbstractSocket
::
SocketError
)),
this
,
SLOT
(
displayError
(
QAbstractSocket
::
SocketError
)),
Qt
::
QueuedConnection
);
connect
(
sock_client
,
&
QTcpSocket
::
bytesWritten
,
this
,
&
zp_netTransThread
::
some_data_sended
,
Qt
::
QueuedConnection
);
connect
(
sock_client
,
&
QTcpSocket
::
bytesWritten
,
this
,
&
zp_netTransThread
::
some_data_sended
,
Qt
::
QueuedConnection
);
connect
(
sock_client
,
&
QTcpSocket
::
connected
,
this
,
&
zp_netTransThread
::
on_encrypted
,
Qt
::
QueuedConnection
);
connect
(
sock_client
,
&
QTcpSocket
::
connected
,
this
,
&
zp_netTransThread
::
on_encrypted
,
Qt
::
QueuedConnection
);
m_mutex_protect
.
lock
();
m_clientList
[
sock_client
]
=
0
;
m_mutex_protect
.
unlock
();
sock_client
->
connectToHost
(
addr
,
port
);
sock_client
->
connectToHost
(
addr
,
port
);
}
}
...
...
ZoomPipeline_FuncSvr/zpmainframe.cpp
浏览文件 @
4137a4c1
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include <QFileDialog>
#include <QFileDialog>
#include <QSqlDatabase>
#include <QSqlDatabase>
#include <QMap>
#include <QMap>
#include "dialogaddressinput.h"
using
namespace
ZPNetwork
;
using
namespace
ZPNetwork
;
using
namespace
ZPTaskEngine
;
using
namespace
ZPTaskEngine
;
using
namespace
ZP_Cluster
;
using
namespace
ZP_Cluster
;
...
@@ -685,3 +686,18 @@ void ZPMainFrame::on_pushButton_db_apply_clicked()
...
@@ -685,3 +686,18 @@ void ZPMainFrame::on_pushButton_db_apply_clicked()
{
{
SaveSettings
(
m_currentConffile
);
SaveSettings
(
m_currentConffile
);
}
}
void
ZPMainFrame
::
on_pushButton_join_clicked
()
{
QSettings
settings
(
this
->
m_currentConffile
,
QSettings
::
IniFormat
);
QString
strAddr
=
settings
.
value
(
"history/clusterAddr"
,
"192.168.1.118"
).
toString
();
QString
strPort
=
settings
.
value
(
"history/clusterPort"
,
"25600"
).
toString
();
DialogAddressInput
inputdlg
(
this
);
inputdlg
.
SetAddr
(
strAddr
,
strPort
);
if
(
inputdlg
.
exec
()
==
QDialog
::
Accepted
)
{
settings
.
setValue
(
"history/clusterAddr"
,
inputdlg
.
addr
());
settings
.
setValue
(
"history/clusterPort"
,
inputdlg
.
port
());
m_pClusterTerm
->
JoinCluster
(
QHostAddress
(
inputdlg
.
addr
()),
inputdlg
.
port
().
toInt
());
}
}
ZoomPipeline_FuncSvr/zpmainframe.h
浏览文件 @
4137a4c1
...
@@ -72,6 +72,7 @@ public slots:
...
@@ -72,6 +72,7 @@ public slots:
void
on_pushButton_cluster_apply_clicked
();
void
on_pushButton_cluster_apply_clicked
();
void
on_pushButton_smartlink_save_clicked
();
void
on_pushButton_smartlink_save_clicked
();
void
on_pushButton_join_clicked
();
};
};
...
...
ZoomPipeline_FuncSvr/zpmainframe.ui
浏览文件 @
4137a4c1
...
@@ -13,6 +13,24 @@
...
@@ -13,6 +13,24 @@
<property
name=
"windowTitle"
>
<property
name=
"windowTitle"
>
<string>
ZPMainFrame
</string>
<string>
ZPMainFrame
</string>
</property>
</property>
<property
name=
"toolTipDuration"
>
<number>
-1
</number>
</property>
<property
name=
"iconSize"
>
<size>
<width>
16
</width>
<height>
16
</height>
</size>
</property>
<property
name=
"toolButtonStyle"
>
<enum>
Qt::ToolButtonIconOnly
</enum>
</property>
<property
name=
"animated"
>
<bool>
true
</bool>
</property>
<property
name=
"tabShape"
>
<enum>
QTabWidget::Rounded
</enum>
</property>
<widget
class=
"QWidget"
name=
"centralWidget"
>
<widget
class=
"QWidget"
name=
"centralWidget"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<item>
...
@@ -890,6 +908,15 @@
...
@@ -890,6 +908,15 @@
<addaction
name=
"menu_Help"
/>
<addaction
name=
"menu_Help"
/>
</widget>
</widget>
<widget
class=
"QToolBar"
name=
"mainToolBar"
>
<widget
class=
"QToolBar"
name=
"mainToolBar"
>
<property
name=
"movable"
>
<bool>
true
</bool>
</property>
<property
name=
"allowedAreas"
>
<set>
Qt::AllToolBarAreas
</set>
</property>
<property
name=
"floatable"
>
<bool>
false
</bool>
</property>
<attribute
name=
"toolBarArea"
>
<attribute
name=
"toolBarArea"
>
<enum>
TopToolBarArea
</enum>
<enum>
TopToolBarArea
</enum>
</attribute>
</attribute>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录