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
33248ce0
Commit
33248ce0
authored
Aug 13, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报文发送给pos,pos返回信息有时候收不到,为了防止订单一直推送,临时返回104,并记录错误信息
parent
bfdf8abd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
src/SocketModule.cpp
+7
-1
src/main.cpp
+4
-1
No files found.
src/SocketModule.cpp
View file @
33248ce0
...
...
@@ -286,9 +286,15 @@ bool TCPClient::read(void *buf, size_t count)
#else
ssize_t
readBytes
=
::
read
(
m_sockfd
,
buf
,
count
);
#endif
if
(
readBytes
==
-
1
)
{
LOG
(
INFO
)
<<
"recv errno:"
<<
errno
;
if
(
11
==
errno
)
{
strcpy
((
char
*
)
buf
,
"{
\"
status_code
\"
: 100,
\"
msg
\"
:
\"
recv errno:11
\"
}"
);
LOG
(
INFO
)
<<
"receive timeout,return 100 to ods,otherwise,this order will repeatedly push"
;
return
true
;
}
m_bValid
=
false
;
return
false
;
}
...
...
src/main.cpp
View file @
33248ce0
...
...
@@ -19,7 +19,7 @@
INITIALIZE_EASYLOGGINGPP
#define VERSION "1.0.6" //版本号
#define VERSION "1.0.6
beta 3
" //版本号
std
::
string
g_init_data
;
std
::
string
g_init_data_ods_back
;
...
...
@@ -442,16 +442,19 @@ bool order_send_to_pos(IN std::string &order_json,IN std::string &ods_json,OUT s
//jsonTool.getOdsResponseData(tmpUtf8, order_json, responseData);
}
else
{
LOG
(
INFO
)
<<
"receive data from pos failed"
;
rlt
=
false
;
}
}
else
{
LOG
(
INFO
)
<<
"send data to pos failed"
;
rlt
=
false
;
}
pos
.
close
();
}
else
{
LOG
(
INFO
)
<<
"connect pos failed,pos_listen_port:"
<<
pos_listen_port
<<
" pos_ip:"
<<
pos_ip
;
rlt
=
false
;
}
jsonTool
.
getOdsResponseData
(
tmp
,
order_json
,
ods_json
,
back_json
);
...
...
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