Use proper buffer factory in NioDatagramWroekr
This commit is contained in:
parent
abfae49a7c
commit
7a06c35238
@ -38,7 +38,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|||||||
|
|
||||||
import org.jboss.netty.buffer.ChannelBuffer;
|
import org.jboss.netty.buffer.ChannelBuffer;
|
||||||
import org.jboss.netty.buffer.ChannelBufferFactory;
|
import org.jboss.netty.buffer.ChannelBufferFactory;
|
||||||
import org.jboss.netty.buffer.ChannelBuffers;
|
|
||||||
import org.jboss.netty.channel.Channel;
|
import org.jboss.netty.channel.Channel;
|
||||||
import org.jboss.netty.channel.ChannelException;
|
import org.jboss.netty.channel.ChannelException;
|
||||||
import org.jboss.netty.channel.ChannelFuture;
|
import org.jboss.netty.channel.ChannelFuture;
|
||||||
@ -402,12 +401,9 @@ class NioDatagramWorker implements Runnable {
|
|||||||
// Update the predictor.
|
// Update the predictor.
|
||||||
predictor.previousReceiveBufferSize(readBytes);
|
predictor.previousReceiveBufferSize(readBytes);
|
||||||
|
|
||||||
// Create a Netty ChannelByffer by wrapping the ByteBuffer.
|
// Notify the interested parties about the newly arrived message.
|
||||||
final ChannelBuffer channelBuffer = ChannelBuffers
|
fireMessageReceived(
|
||||||
.wrappedBuffer(byteBuffer);
|
channel, bufferFactory.getBuffer(byteBuffer), remoteAddress);
|
||||||
|
|
||||||
// Notify the interested parties about the newly arrived message (channelBuffer).
|
|
||||||
fireMessageReceived(channel, channelBuffer, remoteAddress);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user