Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
75f2bc6d
Commit
75f2bc6d
authored
Apr 28, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改测试环境的配置
parent
86c6f246
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
NettyClientHandler.java
...pc/remoting/net/impl/netty/client/NettyClientHandler.java
+1
-1
NettyServerHandler.java
...pc/remoting/net/impl/netty/server/NettyServerHandler.java
+1
-1
NettyClientHandler.java
...main/java/com/byit/client/handler/NettyClientHandler.java
+1
-1
NettyPluginServerHandler.java
...m/byit/server/netty/handler/NettyPluginServerHandler.java
+1
-1
No files found.
byit-myth-rpc/src/main/java/com/byit/rpc/remoting/net/impl/netty/client/NettyClientHandler.java
View file @
75f2bc6d
...
@@ -45,7 +45,7 @@ public class NettyClientHandler extends SimpleChannelInboundHandler<RpcResponse>
...
@@ -45,7 +45,7 @@ public class NettyClientHandler extends SimpleChannelInboundHandler<RpcResponse>
logger.debug(">>>>>>>>>>> myth-rpc netty client close an idle channel.");*/
logger.debug(">>>>>>>>>>> myth-rpc netty client close an idle channel.");*/
nettyConnectClient
.
send
(
Beat
.
BEAT_PING
);
// beat N, close if fail(may throw error)
nettyConnectClient
.
send
(
Beat
.
BEAT_PING
);
// beat N, close if fail(may throw error)
logger
.
info
(
">>>>>>>>>>> myth-rpc netty client send beat-ping."
+
ctx
.
channel
().
id
().
asShortText
()
);
logger
.
info
(
">>>>>>>>>>> myth-rpc netty client send beat-ping."
);
}
else
{
}
else
{
super
.
userEventTriggered
(
ctx
,
evt
);
super
.
userEventTriggered
(
ctx
,
evt
);
...
...
byit-myth-rpc/src/main/java/com/byit/rpc/remoting/net/impl/netty/server/NettyServerHandler.java
View file @
75f2bc6d
...
@@ -71,7 +71,7 @@ public class NettyServerHandler extends SimpleChannelInboundHandler<RpcRequest>
...
@@ -71,7 +71,7 @@ public class NettyServerHandler extends SimpleChannelInboundHandler<RpcRequest>
public
void
userEventTriggered
(
ChannelHandlerContext
ctx
,
Object
evt
)
throws
Exception
{
public
void
userEventTriggered
(
ChannelHandlerContext
ctx
,
Object
evt
)
throws
Exception
{
if
(
evt
instanceof
IdleStateEvent
){
if
(
evt
instanceof
IdleStateEvent
){
ctx
.
channel
().
close
();
// beat 3N, close if idle
ctx
.
channel
().
close
();
// beat 3N, close if idle
logger
.
info
(
">>>>>>>>>>> myth-rpc provider netty server close an idle channel."
+
ctx
.
channel
().
id
()
);
logger
.
info
(
">>>>>>>>>>> myth-rpc provider netty server close an idle channel."
);
}
else
{
}
else
{
super
.
userEventTriggered
(
ctx
,
evt
);
super
.
userEventTriggered
(
ctx
,
evt
);
}
}
...
...
byit-plugin-core/myth-plugin-rpc-client/src/main/java/com/byit/client/handler/NettyClientHandler.java
View file @
75f2bc6d
...
@@ -32,7 +32,7 @@ public class NettyClientHandler extends SimpleChannelInboundHandler<PluginRpcRes
...
@@ -32,7 +32,7 @@ public class NettyClientHandler extends SimpleChannelInboundHandler<PluginRpcRes
//判断事件是否是心跳事件
//判断事件是否是心跳事件
if
(
evt
instanceof
IdleStateEvent
){
if
(
evt
instanceof
IdleStateEvent
){
pluginConnectClient
.
send
(
PluginBeat
.
PLUGIN_RPC_REQUEST_PACKET
);
pluginConnectClient
.
send
(
PluginBeat
.
PLUGIN_RPC_REQUEST_PACKET
);
System
.
out
.
println
(
"------客户端发送心跳请求-----"
+
ctx
.
channel
().
id
().
asShortText
()
);
System
.
out
.
println
(
"------客户端发送心跳请求-----"
);
}
else
{
}
else
{
super
.
userEventTriggered
(
ctx
,
evt
);
super
.
userEventTriggered
(
ctx
,
evt
);
}
}
...
...
byit-plugin-core/myth-plugin-rpc-server/src/main/java/com/byit/server/netty/handler/NettyPluginServerHandler.java
View file @
75f2bc6d
...
@@ -42,7 +42,7 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin
...
@@ -42,7 +42,7 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin
@Override
@Override
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
PluginRpcRequestPacket
msg
)
{
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
PluginRpcRequestPacket
msg
)
{
if
(
PluginBeat
.
BEAT_ID
.
equals
(
msg
.
getRequestId
())){
if
(
PluginBeat
.
BEAT_ID
.
equals
(
msg
.
getRequestId
())){
System
.
out
.
println
(
"------接收到客户端的心跳连接-------"
+
ctx
.
channel
().
id
().
asShortText
()
);
System
.
out
.
println
(
"------接收到客户端的心跳连接-------"
);
return
;
return
;
}
}
PluginRpcResponsePacket
transferPluginRpcResponse
=
new
PluginRpcResponsePacket
();
PluginRpcResponsePacket
transferPluginRpcResponse
=
new
PluginRpcResponsePacket
();
...
...
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