felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1725532 - /felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Telnet.java
Date Tue, 19 Jan 2016 14:34:43 GMT
Author: jawi
Date: Tue Jan 19 14:34:43 2016
New Revision: 1725532

URL: http://svn.apache.org/viewvc?rev=1725532&view=rev
Log:
FELIX-4345 - listen to both IPv4 & IPv6 when ip is empty:

- when an empty IP parameter is given, telnetd now binds to all network addresses.


Modified:
    felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Telnet.java

Modified: felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Telnet.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Telnet.java?rev=1725532&r1=1725531&r2=1725532&view=diff
==============================================================================
--- felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Telnet.java (original)
+++ felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Telnet.java Tue Jan 19
14:34:43 2016
@@ -74,8 +74,7 @@ public class Telnet implements Runnable
         {
             if (server != null)
             {
-                throw new IllegalStateException("telnetd is already running on port "
-                    + port);
+                throw new IllegalStateException("telnetd is already running on port " + port);
             }
             ip = opt.get("ip");
             port = opt.getNumber("port");
@@ -115,8 +114,9 @@ public class Telnet implements Runnable
     private void start() throws IOException
     {
         quit = false;
-        server = new ServerSocket(port, 0, InetAddress.getByName(ip));
-        thread = new Thread(this, "gogo telnet");
+        InetAddress addr = "".equals(ip) ? null : InetAddress.getByName(ip);
+        server = new ServerSocket(port, 0, addr);
+        thread = new Thread(this, "Gogo telnet");
         thread.start();
     }
 



Mime
View raw message