cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1371402 - in /cxf/trunk/rt: ./ transports/udp/ transports/udp/src/main/java/org/apache/cxf/transport/udp/ transports/udp/src/test/java/org/apache/cxf/transport/udp/
Date Thu, 09 Aug 2012 19:23:02 GMT
Author: dkulp
Date: Thu Aug  9 19:23:02 2012
New Revision: 1371402

URL: http://svn.apache.org/viewvc?rev=1371402&view=rev
Log:
Fix the UDP stuff on OSX by making sure the proper buffer size is set

Modified:
    cxf/trunk/rt/pom.xml
    cxf/trunk/rt/transports/udp/pom.xml
    cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
    cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
    cxf/trunk/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java

Modified: cxf/trunk/rt/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/pom.xml?rev=1371402&r1=1371401&r2=1371402&view=diff
==============================================================================
--- cxf/trunk/rt/pom.xml (original)
+++ cxf/trunk/rt/pom.xml Thu Aug  9 19:23:02 2012
@@ -49,7 +49,7 @@
         <module>transports/http</module>
         <module>transports/http-jetty</module>
         <module>transports/jms</module>
-        <!--module>transports/udp</module-->
+        <module>transports/udp</module>
         <module>ws/policy</module>
         <module>ws/addr</module>
         <module>ws/rm</module>

Modified: cxf/trunk/rt/transports/udp/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/udp/pom.xml?rev=1371402&r1=1371401&r2=1371402&view=diff
==============================================================================
--- cxf/trunk/rt/transports/udp/pom.xml (original)
+++ cxf/trunk/rt/transports/udp/pom.xml Thu Aug  9 19:23:02 2012
@@ -68,6 +68,11 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+	<dependency>
+	    <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <scope>test</scope>
+        </dependency>
 
     </dependencies>
 </project>

Modified: cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java?rev=1371402&r1=1371401&r2=1371402&view=diff
==============================================================================
--- cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
(original)
+++ cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
Thu Aug  9 19:23:02 2012
@@ -49,6 +49,7 @@ import org.apache.mina.core.buffer.IoBuf
 import org.apache.mina.core.future.ConnectFuture;
 import org.apache.mina.core.service.IoHandlerAdapter;
 import org.apache.mina.core.session.IoSession;
+import org.apache.mina.transport.socket.DatagramSessionConfig;
 import org.apache.mina.transport.socket.nio.NioDatagramConnector;
 
 /**
@@ -69,6 +70,7 @@ public class UDPConduit extends Abstract
         super(t);
         this.bus = bus;
         connector.getSessionConfig().setReadBufferSize(64 * 1024);
+        connector.getSessionConfig().setSendBufferSize(64 * 1024);
         connector.setHandler(new IoHandlerAdapter() {
             public void messageReceived(IoSession session, Object buf) {
                 Message message = (Message)session.getAttribute(CXF_MESSAGE_ATTR);
@@ -77,7 +79,7 @@ public class UDPConduit extends Abstract
         });
     }
 
-    private void dataReceived(Message message, IoBuffer buf, boolean async) { 
+    private void dataReceived(Message message, IoBuffer buf, boolean async) {
         if (message.getExchange().getInMessage() == null) {
             final Message inMessage = new MessageImpl();
             inMessage.setExchange(message.getExchange());
@@ -181,6 +183,8 @@ public class UDPConduit extends Abstract
                     connFuture.await();
                 }
                 connFuture.getSession().setAttribute(CXF_MESSAGE_ATTR, message);
+                ((DatagramSessionConfig)connFuture.getSession().getConfig()).setSendBufferSize(64
* 1024);
+                ((DatagramSessionConfig)connFuture.getSession().getConfig()).setReceiveBufferSize(64
* 1024);
                 message.setContent(OutputStream.class, new UDPConduitOutputStream(connector,
connFuture, message));
                 message.getExchange().put(ConnectFuture.class, connFuture);
                 message.getExchange().put(HOST_PORT, uri.getHost() + ":" + uri.getPort());

Modified: cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java?rev=1371402&r1=1371401&r2=1371402&view=diff
==============================================================================
--- cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
(original)
+++ cxf/trunk/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
Thu Aug  9 19:23:02 2012
@@ -106,6 +106,7 @@ public class UDPDestination extends Abst
 
             DatagramSessionConfig dcfg = acceptor.getSessionConfig();
             dcfg.setReadBufferSize(64 * 1024);
+            dcfg.setSendBufferSize(64 * 1024);
             dcfg.setReuseAddress(true);
             acceptor.bind();
         } catch (Exception ex) {
@@ -133,6 +134,7 @@ public class UDPDestination extends Abst
     
     
     class UDPIOHandler extends StreamIoHandler implements IoHandler {
+
         protected void processStreamIo(IoSession session, InputStream in, OutputStream out)
{
             final MessageImpl m = new MessageImpl();
             final Exchange exchange = new ExchangeImpl();

Modified: cxf/trunk/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java?rev=1371402&r1=1371401&r2=1371402&view=diff
==============================================================================
--- cxf/trunk/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java
(original)
+++ cxf/trunk/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java
Thu Aug  9 19:23:02 2012
@@ -93,18 +93,16 @@ public class UDPTransportTest extends Ab
     }
     
     @Test
-    public void testLargRequest() throws Exception {
+    public void testLargeRequest() throws Exception {
         JaxWsProxyFactoryBean fact = new JaxWsProxyFactoryBean(); 
         fact.setAddress("udp://localhost:" + PORT);
         Greeter g = fact.create(Greeter.class);
         StringBuilder b = new StringBuilder(100000);
-        for (int x = 0; x < 32100; x++) {
+        for (int x = 0; x < 10000; x++) {
             b.append("Hello ");
         }
         assertEquals("Hello " + b.toString(), g.greetMe(b.toString()));
                
         ((java.io.Closeable)g).close();
-    }
-
-
+    }    
 }



Mime
View raw message