You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/10/09 11:41:32 UTC

svn commit: r1530545 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

Author: markt
Date: Wed Oct  9 09:41:31 2013
New Revision: 1530545

URL: http://svn.apache.org/r1530545
Log:
Use the constant for the buffer sizes (makes it easier to experiment with performance impacts of different buffer sizes)

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1530545&r1=1530544&r2=1530545&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Wed Oct  9 09:41:31 2013
@@ -73,9 +73,9 @@ public abstract class WsRemoteEndpointIm
 
     // Max size of WebSocket header is 14 bytes
     private final ByteBuffer headerBuffer = ByteBuffer.allocate(14);
-    private final ByteBuffer outputBuffer = ByteBuffer.allocate(8192);
+    private final ByteBuffer outputBuffer = ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
     private final CharsetEncoder encoder = new Utf8Encoder();
-    private final ByteBuffer encoderBuffer = ByteBuffer.allocate(8192);
+    private final ByteBuffer encoderBuffer = ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
     private final AtomicBoolean batchingAllowed = new AtomicBoolean(false);
     private volatile long sendTimeout = -1;
     private WsSession wsSession;
@@ -743,7 +743,7 @@ public abstract class WsRemoteEndpointIm
     private static class WsOutputStream extends OutputStream {
 
         private final WsRemoteEndpointImplBase endpoint;
-        private final ByteBuffer buffer = ByteBuffer.allocate(8192);
+        private final ByteBuffer buffer = ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
         private final Object closeLock = new Object();
         private volatile boolean closed = false;
 
@@ -826,7 +826,7 @@ public abstract class WsRemoteEndpointIm
     private static class WsWriter extends Writer {
 
         private final WsRemoteEndpointImplBase endpoint;
-        private final CharBuffer buffer = CharBuffer.allocate(8192);
+        private final CharBuffer buffer = CharBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
         private final Object closeLock = new Object();
         private volatile boolean closed = false;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org