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
d72cfedf
Commit
d72cfedf
authored
Mar 31, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加连接异常处理
parent
f39d547f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
bin/Readme.txt
+2
-0
bin/config.ini
+3
-3
bin/libz.so.1
+0
-0
src/main.cpp
+12
-5
No files found.
bin/Readme.txt
0 → 100644
View file @
d72cfedf
1:把文件拷贝到POS后,需要给“takeaway”文件赋予可执行权限,命令:chmod +x takeaway
\ No newline at end of file
bin/config.ini
View file @
d72cfedf
...
...
@@ -2,9 +2,9 @@
port
=
24446
[ODS]
ip
=
1
15.234.23.176
pushPort
=
8996
recvPort
=
8997
ip
=
1
0.0.100.70
pushPort
=
30001
recvPort
=
30002
socketTimeout
=
60
[POS]
...
...
bin/libz.so.1
0 → 100644
View file @
d72cfedf
File added
src/main.cpp
View file @
d72cfedf
...
...
@@ -98,8 +98,8 @@ void* listen_pos_func(void* arg)
}
else
{
LOG
(
INFO
)
<<
"wait for ods init back data"
;
sleep
(
1
);
}
sleep
(
3
);
}
}
jsonTool
.
setInitData
(
posRequestData
.
data
());
//把初始化数据暂存起来
}
else
...
...
@@ -317,10 +317,17 @@ int main()
LOG
(
INFO
)
<<
"wait for init done"
;
if
(
!
ods
.
isValid
()
){
LOG
(
INFO
)
<<
"ods is not valid"
;
sleep
(
1
);
break
;
}
sleep
(
1
);
}
//如果连接非法,跳出循环重新连接
if
(
!
ods
.
isValid
()
){
break
;
}
//检测是否有发送失败的订单,如果有的话,启动线程,先发送原先失败的订单
sqlite
.
query
(
"select * from fmOrderFailed"
,
vecFailedOrders
);
...
...
@@ -337,13 +344,13 @@ int main()
else
{
LOG
(
INFO
)
<<
"Haven't receive init data"
;
}
sleep
(
1
);
sleep
(
3
);
continue
;
}
}
else
{
LOG
(
INFO
)
<<
"connect ODS failed"
;
sleep
(
2
);
sleep
(
5
);
continue
;
}
}
...
...
@@ -360,7 +367,7 @@ int main()
if
(
ods
.
receive
(
odsPushData
)
)
{
LOG
(
INFO
)
<<
"---------------- ODS ===>> PLUGIN ---------------
.
"
;
LOG
(
INFO
)
<<
"---------------- ODS ===>> PLUGIN ---------------"
;
LOG
(
INFO
)
<<
odsPushData
;
if
(
!
jsonTool
.
isHeartbeatData
(
odsPushData
.
data
())){
if
(
jsonTool
.
convertDataOds2Pos
(
odsPushData
,
pushPosData
)
)
...
...
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