mina-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r798039 - /mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/SshServer.java
Date Mon, 27 Jul 2009 06:47:57 GMT
Author: gnodet
Date: Mon Jul 27 06:47:57 2009
New Revision: 798039

URL: http://svn.apache.org/viewvc?rev=798039&view=rev
Log:
SSHD-32: Reuse address (patch provided by Laurent Duchesne

Modified:
    mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/SshServer.java

Modified: mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/SshServer.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/SshServer.java?rev=798039&r1=798038&r2=798039&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/SshServer.java (original)
+++ mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/SshServer.java Mon Jul 27 06:47:57
2009
@@ -94,6 +94,7 @@
 
     private IoAcceptor acceptor;
     private int port;
+    private boolean reuseAddress = true;
     private List<NamedFactory<UserAuth>> userAuthFactories;
     private List<NamedFactory<ServerChannel>> channelFactories;
     private ShellFactory shellFactory;
@@ -118,6 +119,14 @@
         this.port = port;
     }
 
+    public boolean getReuseAddress() {
+        return reuseAddress;
+    }
+
+    public void setReuseAddress(boolean reuseAddress) {
+        this.reuseAddress = reuseAddress;
+    }
+
     public List<NamedFactory<UserAuth>> getUserAuthFactories() {
         return userAuthFactories;
     }
@@ -213,6 +222,8 @@
         checkConfig();
         acceptor = new NioSocketAcceptor();
 
+        ((NioSocketAcceptor) acceptor).setReuseAddress(reuseAddress);
+
         SessionFactory handler = sessionFactory;
         if (handler == null) {
             handler = new SessionFactory();



Mime
View raw message