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
fabdbcfd
Commit
fabdbcfd
authored
Nov 14, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格式并加些打印
parent
88980bb9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
38 deletions
+27
-38
ForwardClient.java
.../main/java/iot/sixiang/license/forward/ForwardClient.java
+0
-4
TcpClient.java
license/src/main/java/iot/sixiang/license/net/TcpClient.java
+27
-34
No files found.
license/src/main/java/iot/sixiang/license/forward/ForwardClient.java
View file @
fabdbcfd
...
...
@@ -8,8 +8,6 @@ import org.springframework.stereotype.Component;
@Component
@Slf4j
public
class
ForwardClient
{
private
TcpClient
client
=
null
;
private
ForwardChannelInitializer
channelInitializer
;
...
...
@@ -17,7 +15,6 @@ public class ForwardClient {
ForwardClientHandler
handler
;
public
ForwardClient
()
{
}
public
void
startTcp
(
String
host
,
int
port
,
String
appId
)
{
...
...
@@ -31,5 +28,4 @@ public class ForwardClient {
client
=
new
TcpClient
(
host
,
port
,
channelInitializer
,
listener
);
client
.
start
();
}
}
license/src/main/java/iot/sixiang/license/net/TcpClient.java
View file @
fabdbcfd
...
...
@@ -15,7 +15,7 @@ public class TcpClient {
private
BaseChannelInitializer
channelInitializer
;
private
BaseConnectionListener
connectionListener
;
public
TcpClient
(
String
host
,
int
port
,
BaseChannelInitializer
channelInitializer
,
BaseConnectionListener
connectionListener
)
{
public
TcpClient
(
String
host
,
int
port
,
BaseChannelInitializer
channelInitializer
,
BaseConnectionListener
connectionListener
)
{
this
.
host
=
host
;
this
.
port
=
port
;
this
.
channelInitializer
=
channelInitializer
;
...
...
@@ -23,9 +23,7 @@ public class TcpClient {
}
public
void
start
()
{
Thread
thread
=
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
Thread
thread
=
new
Thread
(()
->
{
try
{
EventLoopGroup
eventLoopGroup
=
new
NioEventLoopGroup
();
Bootstrap
bootstrap
=
new
Bootstrap
();
...
...
@@ -39,14 +37,9 @@ public class TcpClient {
future
.
addListener
(
connectionListener
);
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
log
.
error
(
"Tcp客户端异常,端口:{}"
,
port
);
}
log
.
error
(
"Tcp客户端异常,端口:{}"
,
port
);
}
});
thread
.
start
();
}
}
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