tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1245247 - /tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/EchoMessage.java
Date Thu, 16 Feb 2012 23:19:10 GMT
Author: markt
Date: Thu Feb 16 23:19:10 2012
New Revision: 1245247

URL: http://svn.apache.org/viewvc?rev=1245247&view=rev
Log:
Slightly improve example

Modified:
    tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/EchoMessage.java

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/EchoMessage.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/EchoMessage.java?rev=1245247&r1=1245246&r2=1245247&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/EchoMessage.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/EchoMessage.java Thu Feb 16 23:19:10
2012
@@ -38,13 +38,14 @@ public class EchoMessage extends WebSock
 
         @Override
         protected void onBinaryMessage(ByteBuffer message) throws IOException {
-            System.out.write(message.array(), 0, message.limit());
-            System.out.print('\n');
+            message.position(message.limit());
+            getOutbound().writeBinaryMessage(message);
         }
 
         @Override
         protected void onTextMessage(CharBuffer message) throws IOException {
-            System.out.println(message);
+            message.position(message.limit());
+            getOutbound().writeTextMessage(message);
         }
     }
 }



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


Mime
View raw message