cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r890498 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra/net: MessagingService.java UdpConnection.java
Date Mon, 14 Dec 2009 22:08:42 GMT
Author: jbellis
Date: Mon Dec 14 22:08:42 2009
New Revision: 890498

URL: http://svn.apache.org/viewvc?rev=890498&view=rev
Log:
add setReuseAddress for TcpConnection and clean up in UDP.  patch by jbellis

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=890498&r1=890497&r2=890498&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Mon
Dec 14 22:08:42 2009
@@ -192,6 +192,7 @@
     {        
         ServerSocketChannel serverChannel = ServerSocketChannel.open();
         ServerSocket ss = serverChannel.socket();
+        ss.setReuseAddress(true);
         ss.bind(new InetSocketAddress(localEp, DatabaseDescriptor.getStoragePort()));
         serverChannel.configureBlocking(false);
         

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java?rev=890498&r1=890497&r2=890498&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java Mon Dec
14 22:08:42 2009
@@ -43,19 +43,18 @@
     private DatagramChannel socketChannel_;
     private SelectionKey key_;
     
-    public void init() throws IOException
+    public void init() throws IOException // for outgoing messages
     {
         socketChannel_ = DatagramChannel.open();
-        socketChannel_.socket().setReuseAddress(true);
         socketChannel_.configureBlocking(false);        
     }
     
     public void init(InetAddress localEp) throws IOException
     {
         socketChannel_ = DatagramChannel.open();
-        socketChannel_.socket().bind(new InetSocketAddress(localEp, DatabaseDescriptor.getControlPort()));
         socketChannel_.socket().setReuseAddress(true);
-        socketChannel_.configureBlocking(false);        
+        socketChannel_.socket().bind(new InetSocketAddress(localEp, DatabaseDescriptor.getControlPort()));
+        socketChannel_.configureBlocking(false);
         key_ = SelectorManager.getUdpSelectorManager().register(socketChannel_, this, SelectionKey.OP_READ);
     }
     



Mime
View raw message