Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
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
zengtianlai3
ioc_sixiang_license
Commits
23797f49
Commit
23797f49
authored
Nov 15, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格式并加些打印
parent
4de2d7fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
11 deletions
+2
-11
DeviceClientLicenseEventHandler.java
...ixiang/license/event/DeviceClientLicenseEventHandler.java
+0
-5
ForwardConnectionListener.java
...ot/sixiang/license/forward/ForwardConnectionListener.java
+2
-6
No files found.
license/src/main/java/iot/sixiang/license/event/DeviceClientLicenseEventHandler.java
View file @
23797f49
...
...
@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component;
@Component
@Slf4j
public
class
DeviceClientLicenseEventHandler
{
@Autowired
DeviceManager
deviceManager
;
@Autowired
...
...
@@ -33,10 +32,6 @@ public class DeviceClientLicenseEventHandler {
}
else
{
session
.
getClientChannel
().
writeAndFlush
(
protocol
);
log
.
debug
(
"device client license success ..."
);
}
}
}
license/src/main/java/iot/sixiang/license/forward/ForwardConnectionListener.java
View file @
23797f49
...
...
@@ -20,7 +20,7 @@ public class ForwardConnectionListener extends BaseConnectionListener {
public
void
operationComplete
(
ChannelFuture
channelFuture
)
{
AlarmService
alarmService
=
SpringUtil
.
getBean
(
AlarmService
.
class
);
if
(!
channelFuture
.
isSuccess
())
{
//
TODO
失败进行告警
// 失败进行告警
log
.
debug
(
"桥接客户端,连接服务器失败:{},{},{}"
,
this
.
host
,
this
.
port
,
this
.
appId
);
int
typeId
=
1
;
...
...
@@ -28,8 +28,7 @@ public class ForwardConnectionListener extends BaseConnectionListener {
String
content
=
"连接服务器:"
+
this
.
host
+
":"
+
this
.
port
+
"失败"
;
alarmService
.
addAlarm
(
typeId
,
title
,
content
);
//TODO forward client连接失败,则强制踢掉设备客户端
// forward client连接失败,则强制踢掉设备客户端
DeviceClientBeForcedOfflineEvent
deviceClientBeForcedOfflineEvent
=
new
DeviceClientBeForcedOfflineEvent
();
deviceClientBeForcedOfflineEvent
.
setAppId
(
this
.
appId
);
EventPublisher
eventPublisher
=
SpringUtil
.
getBean
(
EventPublisher
.
class
);
...
...
@@ -49,7 +48,6 @@ public class ForwardConnectionListener extends BaseConnectionListener {
EventPublisher
eventPublisher
=
SpringUtil
.
getBean
(
EventPublisher
.
class
);
eventPublisher
.
publishEvent
(
forwardClientConnectEvent
);
short
stx
=
21930
;
byte
ack
=
0x0
;
int
len
=
3
;
...
...
@@ -58,7 +56,6 @@ public class ForwardConnectionListener extends BaseConnectionListener {
content
[
0
]
=
0x7e
;
byte
end
=
0x1
;
DeviceProtocol
protocol
=
new
DeviceProtocol
(
stx
,
len
,
cmd
,
ack
,
content
,
end
);
...
...
@@ -69,5 +66,4 @@ public class ForwardConnectionListener extends BaseConnectionListener {
eventPublisher
.
publishEvent
(
deviceClientLicenseEvent
);
}
}
}
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