X-Git-Url: http://git.megacz.com/?p=org.ibex.jinetd.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjinetd%2FPort.java;h=f00e0de1fed020f5d062e7c70ba2b0407fada25e;hp=2aded0ad53d0eac06e1e65f90d952d57cf26f3b6;hb=5a70dae9ae337182636a4c4d59951019a24e9f34;hpb=7b717a47e5def749c6913e4019801ce4a9225f01 diff --git a/src/org/ibex/jinetd/Port.java b/src/org/ibex/jinetd/Port.java index 2aded0a..f00e0de 100644 --- a/src/org/ibex/jinetd/Port.java +++ b/src/org/ibex/jinetd/Port.java @@ -8,13 +8,13 @@ import java.util.zip.*; public class Port extends Loader { - private final NetworkInterface iface; + private final InetAddress bindTo; private final int port; private final Thread listener; - public Port(String path, NetworkInterface iface, int port) { + public Port(String path, InetAddress bindTo, int port) { super(path); - this.iface = iface; + this.bindTo = bindTo; this.port = port; this.listener = new PortThread(); listener.start(); @@ -86,8 +86,8 @@ public class Port extends Loader { private class PortThread extends Thread { public void run() { try { - Log.warn(this, "Now listening on interface " + iface + ", port " + port); - ServerSocket ss = new ServerSocket(port); + Log.warn(this, "Now listening on address " + bindTo + ", port " + port); + ServerSocket ss = bindTo == null ? new ServerSocket(port) : new ServerSocket(port, 0, bindTo); for(Socket s = ss.accept(); ; s = ss.accept()) try { Log.warn(this, "accepted connection on port " + port); dispatch(new Connection(s, "megacz.com"));