Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e01081f2
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e01081f2
编写于
4月 13, 2020
作者:
J
Jeff Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename some structures
上级
704d8da0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
24 deletion
+24
-24
src/rpc/src/rpcCache.c
src/rpc/src/rpcCache.c
+5
-5
src/rpc/src/rpcHaship.c
src/rpc/src/rpcHaship.c
+7
-7
src/rpc/src/rpcUdp.c
src/rpc/src/rpcUdp.c
+12
-12
未找到文件。
src/rpc/src/rpcCache.c
浏览文件 @
e01081f2
...
...
@@ -22,18 +22,18 @@
#include "tutil.h"
#include "rpcCache.h"
typedef
struct
_c_hash_t
{
typedef
struct
SConnHash
{
uint32_t
ip
;
uint16_t
port
;
char
connType
;
struct
_c_hash_t
*
prev
;
struct
_c_hash_t
*
next
;
void
*
data
;
struct
SConnHash
*
prev
;
struct
SConnHash
*
next
;
void
*
data
;
uint64_t
time
;
}
SConnHash
;
typedef
struct
{
SConnHash
**
connHashList
;
SConnHash
**
connHashList
;
mpool_h
connHashMemPool
;
int
maxSessions
;
int
total
;
...
...
src/rpc/src/rpcHaship.c
浏览文件 @
e01081f2
...
...
@@ -17,13 +17,13 @@
#include "tlog.h"
#include "tmempool.h"
typedef
struct
_ip_hash_t
{
typedef
struct
SIpHash
{
uint32_t
ip
;
uint16_t
port
;
int
hash
;
struct
_ip_hash_t
*
prev
;
struct
_ip_hash_t
*
next
;
void
*
data
;
struct
SIpHash
*
prev
;
struct
SIpHash
*
next
;
void
*
data
;
}
SIpHash
;
typedef
struct
{
...
...
@@ -47,7 +47,7 @@ int rpcHashIp(void *handle, uint32_t ip, uint16_t port) {
void
*
rpcAddIpHash
(
void
*
handle
,
void
*
data
,
uint32_t
ip
,
uint16_t
port
)
{
int
hash
;
SIpHash
*
pNode
;
SIpHash
*
pNode
;
SHashObj
*
pObj
;
pObj
=
(
SHashObj
*
)
handle
;
...
...
@@ -70,7 +70,7 @@ void *rpcAddIpHash(void *handle, void *data, uint32_t ip, uint16_t port) {
void
rpcDeleteIpHash
(
void
*
handle
,
uint32_t
ip
,
uint16_t
port
)
{
int
hash
;
SIpHash
*
pNode
;
SIpHash
*
pNode
;
SHashObj
*
pObj
;
pObj
=
(
SHashObj
*
)
handle
;
...
...
@@ -102,7 +102,7 @@ void rpcDeleteIpHash(void *handle, uint32_t ip, uint16_t port) {
void
*
rpcGetIpHash
(
void
*
handle
,
uint32_t
ip
,
uint16_t
port
)
{
int
hash
;
SIpHash
*
pNode
;
SIpHash
*
pNode
;
SHashObj
*
pObj
;
pObj
=
(
SHashObj
*
)
handle
;
...
...
src/rpc/src/rpcUdp.c
浏览文件 @
e01081f2
...
...
@@ -32,7 +32,7 @@
int
tsUdpDelay
=
0
;
typedef
struct
{
void
*
signature
;
void
*
signature
;
int
index
;
int
fd
;
uint16_t
port
;
// peer port
...
...
@@ -53,23 +53,23 @@ typedef struct {
int
server
;
char
ip
[
16
];
// local IP
uint16_t
port
;
// local Port
void
*
shandle
;
// handle passed by upper layer during server initialization
void
*
shandle
;
// handle passed by upper layer during server initialization
int
threads
;
char
label
[
12
];
void
*
tmrCtrl
;
void
*
tmrCtrl
;
void
*
(
*
fp
)(
SRecvInfo
*
pPacket
);
SUdpConn
udpConn
[];
}
SUdpConnSet
;
typedef
struct
{
void
*
signature
;
void
*
signature
;
uint32_t
ip
;
// dest IP
uint16_t
port
;
// dest Port
SUdpConn
*
pConn
;
SUdpConn
*
pConn
;
struct
sockaddr_in
destAdd
;
void
*
msgHdr
;
void
*
msgHdr
;
int
totalLen
;
void
*
timer
;
void
*
timer
;
int
emptyNum
;
}
SUdpBuf
;
...
...
@@ -78,8 +78,8 @@ static SUdpBuf *taosCreateUdpBuf(SUdpConn *pConn, uint32_t ip, uint16_t port);
static
void
taosProcessUdpBufTimer
(
void
*
param
,
void
*
tmrId
);
void
*
taosInitUdpConnection
(
char
*
ip
,
uint16_t
port
,
char
*
label
,
int
threads
,
void
*
fp
,
void
*
shandle
)
{
SUdpConn
*
pConn
;
SUdpConnSet
*
pSet
;
SUdpConn
*
pConn
;
SUdpConnSet
*
pSet
;
int
size
=
(
int
)
sizeof
(
SUdpConnSet
)
+
threads
*
(
int
)
sizeof
(
SUdpConn
);
pSet
=
(
SUdpConnSet
*
)
malloc
((
size_t
)
size
);
...
...
@@ -164,7 +164,7 @@ void *taosInitUdpConnection(char *ip, uint16_t port, char *label, int threads, v
void
taosCleanUpUdpConnection
(
void
*
handle
)
{
SUdpConnSet
*
pSet
=
(
SUdpConnSet
*
)
handle
;
SUdpConn
*
pConn
;
SUdpConn
*
pConn
;
if
(
pSet
==
NULL
)
return
;
...
...
@@ -205,10 +205,10 @@ void *taosOpenUdpConnection(void *shandle, void *thandle, char *ip, uint16_t por
}
static
void
*
taosRecvUdpData
(
void
*
param
)
{
SUdpConn
*
pConn
=
param
;
struct
sockaddr_in
sourceAdd
;
int
dataLen
;
unsigned
int
addLen
;
SUdpConn
*
pConn
=
(
SUdpConn
*
)
param
;
uint16_t
port
;
int
minSize
=
sizeof
(
SRpcHead
);
SRecvInfo
recvInfo
;
...
...
@@ -274,7 +274,7 @@ static void *taosRecvUdpData(void *param) {
int
taosSendUdpData
(
uint32_t
ip
,
uint16_t
port
,
void
*
data
,
int
dataLen
,
void
*
chandle
)
{
SUdpConn
*
pConn
=
(
SUdpConn
*
)
chandle
;
SUdpBuf
*
pBuf
;
SUdpBuf
*
pBuf
;
if
(
pConn
==
NULL
||
pConn
->
signature
!=
pConn
)
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录