Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FMTestPOS
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
zhenfei.zhang
FMTestPOS
Commits
966690c1
Commit
966690c1
authored
Jan 17, 2018
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.实现可配置网络读写超时时间 2.更换图标
parent
65d8ad3b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
3 deletions
+3
-3
Downloads/FMTestPOS.exe
+0
-0
POS/res/pos.ico
+0
-0
POS/res/pos.png
+0
-0
POS/setting.cpp
+3
-3
No files found.
Downloads/FMTestPOS.exe
View file @
966690c1
No preview for this file type
POS/res/pos.ico
View file @
966690c1
No preview for this file type
POS/res/pos.png
0 → 100644
View file @
966690c1
948 Bytes
POS/setting.cpp
View file @
966690c1
...
...
@@ -244,7 +244,7 @@ bool Setting::doRequest(const QByteArray &reqData, QByteArray &rspData)
int
sendDataLen
=
reqData
.
length
();
// 如果需要,加上消息头
if
(
Instance
()
->
settingObj
[
"NeedSocketHeader"
].
toBool
())
{
if
(
Instance
()
->
settingObj
[
"NeedSocketHeader"
].
toBool
()
||
true
)
{
char
*
sendDataWithHeader
=
new
char
[
sendDataLen
+
sizeof
(
FMSOCKHEADER
)];
FMSOCKHEADER
header
=
{
0
,
0
,
0
};
header
.
flag
=
0x4d46
;
...
...
@@ -259,12 +259,12 @@ bool Setting::doRequest(const QByteArray &reqData, QByteArray &rspData)
socket
.
write
(
sendData
,
sendDataLen
);
}
if
(
!
socket
.
waitForBytesWritten
(
10
*
1000
))
{
if
(
!
socket
.
waitForBytesWritten
())
{
Instance
()
->
setErrorString
(
QString
(
"Write data failed. "
).
arg
(
socket
.
errorString
()));
socket
.
close
();
return
false
;
}
if
(
!
socket
.
waitForReadyRead
())
{
if
(
!
socket
.
waitForReadyRead
(
1000
*
Instance
()
->
settingObj
[
"WaitReadTime"
].
toInt
(
120
)
))
{
Instance
()
->
setErrorString
(
QString
(
"Read data failed."
).
arg
(
socket
.
errorString
()));
socket
.
close
();
return
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