You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2011/04/28 02:08:11 UTC
svn commit: r1097290 - in
/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp:
SslTransportFactory.java TcpTransportFactory.java TcpTransportServer.java
Author: chirino
Date: Thu Apr 28 00:08:10 2011
New Revision: 1097290
URL: http://svn.apache.org/viewvc?rev=1097290&view=rev
Log:
Configure the receive buffer size on the server socket so that it get properly set on the sockets that get accepted.
Modified:
activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java
activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java
activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java
Modified: activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java?rev=1097290&r1=1097289&r2=1097290&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java (original)
+++ activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/SslTransportFactory.java Thu Apr 28 00:08:10 2011
@@ -57,7 +57,7 @@ public class SslTransportFactory extends
return null;
}
- /**
+ /**
* Maps uri schemes to a protocol algorithm names.
* Valid algorithm names listed at:
* http://download.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html#SSLContext
Modified: activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java?rev=1097290&r1=1097289&r2=1097290&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java (original)
+++ activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java Thu Apr 28 00:08:10 2011
@@ -49,8 +49,9 @@ public class TcpTransportFactory impleme
if (server == null) return null;
Map<String, String> options = new HashMap<String, String>(URISupport.parseParamters(uri));
+ Map<String, String> copy = new HashMap<String, String>(options);
IntrospectionSupport.setProperties(server, options);
- server.setTransportOption(options);
+ server.setTransportOption(copy);
return server;
}
Modified: activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java?rev=1097290&r1=1097289&r2=1097290&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java (original)
+++ activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java Thu Apr 28 00:08:10 2011
@@ -24,6 +24,7 @@ import org.apache.activemq.apollo.util.I
import org.fusesource.hawtdispatch.Dispatch;
import org.fusesource.hawtdispatch.DispatchQueue;
import org.fusesource.hawtdispatch.DispatchSource;
+import sun.util.LocaleServiceProviderPool;
import java.io.IOException;
import java.net.*;
@@ -50,6 +51,7 @@ public class TcpTransportServer implemen
private TransportAcceptListener listener;
private DispatchQueue dispatchQueue;
private DispatchSource acceptSource;
+ private int receive_buffer_size = 64*1024;
public TcpTransportServer(URI location) throws UnknownHostException {
bindScheme = location.getScheme();
@@ -90,6 +92,10 @@ public class TcpTransportServer implemen
try {
channel = ServerSocketChannel.open();
channel.configureBlocking(false);
+ try {
+ channel.socket().setReceiveBufferSize(receive_buffer_size);
+ } catch (SocketException ignore) {
+ }
channel.socket().bind(bindAddress, backlog);
} catch (IOException e) {
throw IOExceptionSupport.create("Failed to bind to server socket: " + bindAddress + " due to: " + e, e);
@@ -207,4 +213,13 @@ public class TcpTransportServer implemen
return getBoundAddress();
}
+
+ public int getReceive_buffer_size() {
+ return receive_buffer_size;
+ }
+
+ public void setReceive_buffer_size(int receive_buffer_size) {
+ this.receive_buffer_size = receive_buffer_size;
+ }
+
}
\ No newline at end of file