ServerClient icon indicating copy to clipboard operation
ServerClient copied to clipboard

Results 2 ServerClient issues
Sort by recently updated
recently updated
newest added

在代码 当中就是个main调用,打成包丢在Tomcat 里面就可以吗?求大佬指教,小白还请多包涵

Hi 楼主,很高兴能在网上看到你的项目,让我能够自学的时候练习一把 现在刚刚把server部分实现完,client还没到 我在实现的时候发现BaseMsg这个类可以改进一下,我增加了一个方法 **_public abstract void dealWithServerMsg(ChannelHandlerContext ctx);_** 这样在ServerHandler端就可以用回调的方法来handle不同type的message,而且如果后期加入别的message,只用实现接口,而不用更改server的设置 _if(msg.getClientId() == null) { AbstractMsg loginMsg = new LoginMsg(); ctx.channel().writeAndFlush(loginMsg); } else { // 回调机制,由message本身来完成操作 msg.dealWithMessage(ctx); }_ 可以互相交流一下哈