Skip to content

Commit

Permalink
Deleted the error message if a client disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeusSeinGrossopa committed Dec 26, 2022
1 parent 392e132 commit 8de4c1b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ protected void channelRead0(ChannelHandlerContext channel, Object object) throws
String message = ((ByteBuf) object).toString(Charset.defaultCharset());
System.out.println("Received Message: " + message);
}

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if(!cause.getMessage().equals("Connection reset"))
super.exceptionCaught(ctx, cause);
}
}

0 comments on commit 8de4c1b

Please sign in to comment.