Author: fhanik
Date: Thu Apr 13 14:06:57 2006
New Revision: 393941

URL: http://svn.apache.org/viewcvs?rev=393941&view=rev
Log:
Problem with reusing the send buffer on windows, still investigating, this is a 
temporary workaround

Modified:
    
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java
    
tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/ChannelCreator.java
    
tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/MapDemo.java

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java?rev=393941&r1=393940&r2=393941&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java
 Thu Apr 13 14:06:57 2006
@@ -294,9 +294,11 @@
            remaining = current.length;
            curPos = 0;
            ackbuf.clear();
-           if ( writebuf != null ) writebuf.clear();
-           else writebuf = getBuffer(length);
-           if ( writebuf.capacity() > length ) writebuf = getBuffer(length);
+//todo, reuse the buffers, this causes problems on windows
+//           if ( writebuf != null ) writebuf.clear();
+//           else writebuf = getBuffer(length);
+           writebuf = getBuffer(length);
+           if ( writebuf.capacity() < length ) writebuf = getBuffer(length);
            writebuf.put(data,offset,length);
            writebuf.rewind();
            if (isConnected()) {

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/ChannelCreator.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/ChannelCreator.java?rev=393941&r1=393940&r2=393941&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/ChannelCreator.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/ChannelCreator.java
 Thu Apr 13 14:06:57 2006
@@ -43,7 +43,8 @@
  * @version 1.0
  */
 public class ChannelCreator {
-
+    
+    org.apache.commons.logging.impl.LogFactoryImpl impl=null;
     public static StringBuffer usage() {
         StringBuffer buf = new StringBuffer();
         buf.append("\n\t\t[-bind tcpbindaddress]")
@@ -201,6 +202,7 @@
             MessageDispatchInterceptor mi = new MessageDispatchInterceptor();
             mi.setMaxQueueSize(asyncsize);
             channel.addInterceptor(mi);
+            System.out.println("Added MessageDispatchInterceptor");
         }
         
         return channel;

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/MapDemo.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/MapDemo.java?rev=393941&r1=393940&r2=393941&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/MapDemo.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/test/org/apache/catalina/tribes/demos/MapDemo.java
 Thu Apr 13 14:06:57 2006
@@ -44,8 +44,8 @@
     protected LazyReplicatedMap map;
     protected SimpleTableDemo table;
     
-    public MapDemo(Channel channel ) {
-        map = new LazyReplicatedMap(null,channel,5000, "MapDemo",null);
+    public MapDemo(Channel channel, String mapName ) {
+        map = new LazyReplicatedMap(null,channel,5000, mapName,null);
         table = 
SimpleTableDemo.createAndShowGUI(map,channel.getLocalMember(false).getName());
         channel.addChannelListener(this);
         channel.addMembershipListener(this);
@@ -71,17 +71,21 @@
     
     public static void usage() {
         System.out.println("Tribes MapDemo.");
-        System.out.println("Usage:\n\t" +
-                           "java MapDemo [channel options]\n\t" +
+        System.out.println("Usage:\n\t" + 
+                           "java MapDemo [channel options] mapName\n\t" +
                            "\tChannel options:" +
                            ChannelCreator.usage());
     }
 
     public static void main(String[] args) throws Exception {
         ManagedChannel channel = (ManagedChannel) 
ChannelCreator.createChannel(args);
+        String mapName = "MapDemo";
+        if ( args.length > 0 && (!args[args.length-1].startsWith("-"))) {
+            mapName = args[args.length-1];
+        }
         channel.start(channel.DEFAULT);
         Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
-        MapDemo demo = new MapDemo(channel);
+        MapDemo demo = new MapDemo(channel,mapName);
         
         System.out.println("System test complete, sleeping to let threads 
finish.");
         Thread.sleep(60 * 1000 * 60);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to