tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1173082 - in /tomcat/trunk: java/org/apache/coyote/http11/Http11NioProtocol.java test/org/apache/catalina/comet/TestCometProcessor.java
Date Tue, 20 Sep 2011 11:02:42 GMT
Author: markt
Date: Tue Sep 20 11:02:41 2011
New Revision: 1173082

URL: http://svn.apache.org/viewvc?rev=1173082&view=rev
Log:
Remove empty comment

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
    tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1173082&r1=1173081&r2=1173082&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Tue Sep 20 11:02:41
2011
@@ -93,8 +93,6 @@ public class Http11NioProtocol extends A
     public long getSelectorTimeout() {
         return ((NioEndpoint)endpoint).getSelectorTimeout();
     }
-    // *
-
     
     public void setAcceptorThreadPriority(int threadPriority) {
         ((NioEndpoint)endpoint).setAcceptorThreadPriority(threadPriority);

Modified: tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java?rev=1173082&r1=1173081&r2=1173082&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java (original)
+++ tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java Tue Sep 20 11:02:41
2011
@@ -124,6 +124,7 @@ public class TestCometProcessor extends 
 
         // Setup Tomcat instance
         Tomcat tomcat = getTomcatInstance();
+        tomcat.getConnector().setAttribute("connectionTimeout", "200000");
         Context root = tomcat.addContext("", TEMP_DIR);
         Tomcat.addServlet(root, "comet", new SimpleCometServlet());
         root.addServletMapping("/", "comet");
@@ -132,7 +133,8 @@ public class TestCometProcessor extends 
         // Create connection to Comet servlet
         final Socket socket =
             SocketFactory.getDefault().createSocket("localhost", getPort());
-        socket.setSoTimeout(10000);
+        socket.setSoTimeout(100000);
+        System.out.println(socket.getLocalPort());
         
         final OutputStream os = socket.getOutputStream();
         String requestLine = "POST http://localhost:" + getPort() +
@@ -160,7 +162,12 @@ public class TestCometProcessor extends 
             Thread.sleep(100);
             count ++;
         }
-
+        System.out.println("Writer sent " + writeThread.getPingCount() +
+                " pings");
+        if (writeThread.isAlive()) {
+            System.out.println("Writer not stopped");
+        }
+        
         // Wait for the read thread to stop
         count = 0;
         while (readThread.isAlive() && count < 100) {
@@ -228,12 +235,13 @@ public class TestCometProcessor extends 
 
     private static class PingWriterThread extends Thread {
         
-        private int pingCount;
+        private int maxPingCount;
+        private volatile int pingCount;
         private OutputStream os;
         private volatile Exception e = null;
 
-        public PingWriterThread(int pingCount, OutputStream os) {
-            this.pingCount = pingCount;
+        public PingWriterThread(int maxPingCount, OutputStream os) {
+            this.maxPingCount = maxPingCount;
             this.os = os;
         }
 
@@ -241,10 +249,14 @@ public class TestCometProcessor extends 
             return e;
         }
 
+        public int getPingCount() {
+            return pingCount;
+        }
+
         @Override
         public void run() {
             try {
-                for (int i = 0; i < pingCount; i++) {
+                for (pingCount = 0; pingCount < maxPingCount; pingCount++) {
                     os.write("4\r\n".getBytes());
                     os.write("PING\r\n".getBytes());
                     os.flush();



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


Mime
View raw message