shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.walker.tcp;
 
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
 
public class HelloClientHandler extends SimpleChannelInboundHandler<String> {
 
        @Override
         protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
 
             System.out.println("Server say : " + msg);
         }
 
         @Override
         public void channelActive(ChannelHandlerContext ctx) throws Exception {
             System.out.println("Client active ");
             super.channelActive(ctx);
         }
 
         @Override
         public void channelInactive(ChannelHandlerContext ctx) throws Exception {
             System.out.println("Client close ");
             super.channelInactive(ctx);
         }
}