Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
familyMart_takeaway
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guanghui.cui
familyMart_takeaway
Commits
cb5cd820
Commit
cb5cd820
authored
Mar 29, 2022
by
wuyang.zou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dns failed > 3 ,App Will Quit
parent
82183d7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/main.cpp
+5
-5
No files found.
src/main.cpp
View file @
cb5cd820
...
@@ -106,7 +106,7 @@ void* listen_pos_func(void* arg)
...
@@ -106,7 +106,7 @@ void* listen_pos_func(void* arg)
int
reqType
=
jsonTool
.
getPushType
(
posRequestData
.
data
());
int
reqType
=
jsonTool
.
getPushType
(
posRequestData
.
data
());
LOG
(
INFO
)
<<
"Pos ReqType:"
<<
reqType
;
LOG
(
INFO
)
<<
"Pos ReqType:"
<<
reqType
;
if
(
reqType
==
REQUEST_TYPE_INIT
)
{
if
(
reqType
==
REQUEST_TYPE_INIT
)
{
// POS请求类型:: 登录初始化;
// POS请求类型:: 登录初始化;
// 如果当前内存标识: 插件已接受到, Pos发送过来的登录请求, 初始化标识完成;将断开 插件与 ODS 的长连接, 等待后面插件再与ODS重新连接
// 如果当前内存标识: 插件已接受到, Pos发送过来的登录请求, 初始化标识完成;将断开 插件与 ODS 的长连接, 等待后面插件再与ODS重新连接
if
(
bInitDone
)
{
if
(
bInitDone
)
{
...
@@ -274,7 +274,7 @@ void simulator_pos_send_init() {
...
@@ -274,7 +274,7 @@ void simulator_pos_send_init() {
if
(
simulator_pos_client
.
doConnect
(
client_listen_port
,
pos_ip
.
c_str
()))
{
if
(
simulator_pos_client
.
doConnect
(
client_listen_port
,
pos_ip
.
c_str
()))
{
simulator_pos_client
.
setSocketTimeout
(
360
);
//设置超时
simulator_pos_client
.
setSocketTimeout
(
360
);
//设置超时
if
(
simulator_pos_client
.
write
(
g_simulator_pos_req_data
.
data
()
)
){
if
(
simulator_pos_client
.
write
(
g_simulator_pos_req_data
.
data
()
)
)
{
//等待POS-Plugin返回初始化结果
//等待POS-Plugin返回初始化结果
char
tmpBuf
[
FM_BUF_SIZE
]
=
{
0
};
char
tmpBuf
[
FM_BUF_SIZE
]
=
{
0
};
simulator_pos_send_init_ret
=
simulator_pos_client
.
read
(
tmpBuf
,
sizeof
(
tmpBuf
)
);
simulator_pos_send_init_ret
=
simulator_pos_client
.
read
(
tmpBuf
,
sizeof
(
tmpBuf
)
);
...
@@ -510,7 +510,7 @@ int main(int argc,char *argv[])
...
@@ -510,7 +510,7 @@ int main(int argc,char *argv[])
if
(
!
bPriorityDone
){
if
(
!
bPriorityDone
){
LOG
(
INFO
)
<<
"ODS set priority send:"
<<
g_set_pos_priority
.
data
();
LOG
(
INFO
)
<<
"ODS set priority send:"
<<
g_set_pos_priority
.
data
();
if
(
longConnectionOds
.
send
(
g_set_pos_priority
)
)
{
if
(
longConnectionOds
.
send
(
g_set_pos_priority
)
)
{
longConnectionOds
.
receive
(
odsPushData
);
longConnectionOds
.
receive
(
odsPushData
);
g_set_pos_priority_ods_back
=
odsPushData
;
g_set_pos_priority_ods_back
=
odsPushData
;
LOG
(
INFO
)
<<
"ODS set priority back:"
<<
odsPushData
.
data
();
LOG
(
INFO
)
<<
"ODS set priority back:"
<<
odsPushData
.
data
();
...
@@ -524,7 +524,7 @@ int main(int argc,char *argv[])
...
@@ -524,7 +524,7 @@ int main(int argc,char *argv[])
LOG
(
INFO
)
<<
odsPushData
;
LOG
(
INFO
)
<<
odsPushData
;
int
dataType
=
jsonTool
.
isHeartbeatData
(
odsPushData
.
data
());
int
dataType
=
jsonTool
.
isHeartbeatData
(
odsPushData
.
data
());
if
(
2
==
dataType
)
{
//ODS Push Order Data ReqCommand;
if
(
2
==
dataType
)
{
//ODS Push Order Data ReqCommand;
if
(
jsonTool
.
convertDataOds2Pos
(
odsPushData
,
pushPosData
)
)
{
if
(
jsonTool
.
convertDataOds2Pos
(
odsPushData
,
pushPosData
)
)
{
LOG
(
INFO
)
<<
"----------- PLUGIN ===>> POS ------------"
;
LOG
(
INFO
)
<<
"----------- PLUGIN ===>> POS ------------"
;
...
@@ -556,7 +556,7 @@ int main(int argc,char *argv[])
...
@@ -556,7 +556,7 @@ int main(int argc,char *argv[])
bool
rlt
=
longConnectionOds
.
send
(
responseData
);
bool
rlt
=
longConnectionOds
.
send
(
responseData
);
LOG
(
INFO
)
<<
"send to ods result:"
<<
rlt
;
LOG
(
INFO
)
<<
"send to ods result:"
<<
rlt
;
}
else
if
(
1
==
dataType
)
{
//ODS Send Heartbeat ReqCommand;
}
else
if
(
1
==
dataType
)
{
//ODS Send Heartbeat ReqCommand;
if
(
!
bInitDone
)
{
if
(
!
bInitDone
)
{
longConnectionOds
.
setValid
(
false
);
longConnectionOds
.
setValid
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment