Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zhmes-agecal
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
zhmes-agecal
Commits
bbbfbcb6
Commit
bbbfbcb6
authored
Jun 05, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 每次读取后 关闭 socket连接
parent
16a45a69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
ReceiverThread.java
...main/java/com/zehong/common/utils/TCP/ReceiverThread.java
+8
-3
No files found.
zhmes-agecal-common/src/main/java/com/zehong/common/utils/TCP/ReceiverThread.java
View file @
bbbfbcb6
...
...
@@ -34,13 +34,18 @@ public class ReceiverThread extends Thread {
// 将接收到的字节转换为十六进制字符串显示
hexResponse
=
HexUtils
.
bytesToHex
(
responseBytes
);
log
.
info
(
"收到服务器响应: "
+
hexResponse
);
if
(
hexResponse
.
length
()
=
=
58
)
{
socket
.
close
()
;
if
(
hexResponse
.
length
()
>
=
58
)
{
break
;
}
}
log
.
info
(
"解析完了啊啊啊啊啊: "
+
hexResponse
);
}
catch
(
IOException
e
)
{
log
.
error
(
"接收数据失败: "
+
e
.
getMessage
());
}
finally
{
try
{
socket
.
close
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
...
...
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