Code polish

This commit is contained in:
nathan 2016-03-10 17:19:32 +01:00
parent c4fa7253ea
commit 58a20b2913
2 changed files with 2 additions and 4 deletions

View File

@ -45,7 +45,6 @@ class KryoDecoderUdpCrypto extends MessageToMessageDecoder<DatagramPacket> {
ChannelHandler last = ctx.pipeline()
.last();
try {
ByteBuf data = in.content();
Object object = serializationManager.readWithCrypto((ConnectionImpl) last, data, data.readableBytes());

View File

@ -63,10 +63,9 @@ class KryoEncoderUdp extends MessageToMessageEncoder<Object> {
writeObject(this.serializationManager, ctx, msg, outBuffer);
// have to check to see if we are too big for UDP!
if (outBuffer.readableBytes() > EndPoint.udpMaxSize) {
System.err.println("Object larger than MAX udp size! " + EndPoint.udpMaxSize + "/" + outBuffer.readableBytes());
if (outBuffer.readableBytes() > maxSize) {
String message = "Object is TOO BIG FOR UDP! " + msg.toString() + " (" + EndPoint.udpMaxSize + "/" +
String message = "Object is TOO BIG FOR UDP! " + msg.toString() + " (Max " + maxSize + ", was " +
outBuffer.readableBytes() + ")";
LoggerFactory.getLogger(this.getClass()).error(message);
throw new IOException(message);