Author: jfrederic.clere(a)jboss.com
Date: 2009-11-25 12:36:34 -0500 (Wed, 25 Nov 2009)
New Revision: 1296
Modified:
sandbox/webapps/src/CometServletTest1.java
Log:
Cleaner trace.
Modified: sandbox/webapps/src/CometServletTest1.java
===================================================================
--- sandbox/webapps/src/CometServletTest1.java 2009-11-25 16:30:20 UTC (rev 1295)
+++ sandbox/webapps/src/CometServletTest1.java 2009-11-25 17:36:34 UTC (rev 1296)
@@ -75,12 +75,15 @@
// Using while (true): Not checking if input is available will trigger a
blocking
// read. No other event should be triggered (the current READ event will be
in progress
// until the read timeouts, which will trigger an ERROR event due to an
IOException).
- // while (true) {
+ int count = 0;
while (is.available() > 0) {
- int c = is.read();
- count++;
+ int len = is.available();
+ byte [] buf = new byte[len];
+ int c = is.read(buf);
+ count = count + c;
+ String buff = new String(buf);
+ System.out.println("[" +
event.getHttpServletRequest().getSession(true).getId() + "] READ: " + buff);
}
- // }
break;
case TIMEOUT:
// This will cause a generic event to be sent to the servlet every time the
connection is idle for
Show replies by date