Author: david.lloyd(a)jboss.com
Date: 2010-03-25 20:56:45 -0400 (Thu, 25 Mar 2010)
New Revision: 5839
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/RemoteConnection.java
Log:
JBREM-1215 stopgap: Make sure the buffer allocator message size matches the channel
message size
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/RemoteConnection.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/RemoteConnection.java 2010-03-25
23:32:01 UTC (rev 5838)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/RemoteConnection.java 2010-03-26
00:56:45 UTC (rev 5839)
@@ -33,6 +33,7 @@
import org.jboss.xnio.Buffers;
import org.jboss.xnio.IoUtils;
import org.jboss.xnio.OptionMap;
+import org.jboss.xnio.Options;
import org.jboss.xnio.Pool;
import org.jboss.xnio.channels.Channels;
import org.jboss.xnio.channels.ConnectedStreamChannel;
@@ -42,7 +43,7 @@
final class RemoteConnection extends AbstractHandleableCloseable<RemoteConnection>
implements Closeable {
private final ConnectedStreamChannel<InetSocketAddress> channel;
private final ProviderDescriptor providerDescriptor;
- private final Pool<ByteBuffer> bufferPool =
Buffers.createHeapByteBufferAllocator(4096);
+ private final Pool<ByteBuffer> bufferPool;
private final MessageHandler.Setter messageHandlerSetter;
private final OptionMap optionMap;
private final Object writeLock = new Object();
@@ -53,6 +54,7 @@
this.channel = channel;
this.providerDescriptor = providerDescriptor;
messageHandlerSetter = Channels.createMessageReader(channel, optionMap);
+ bufferPool =
Buffers.createHeapByteBufferAllocator(optionMap.get(Options.MAX_INBOUND_MESSAGE_SIZE,
2048));
this.optionMap = optionMap;
}