private Port(String path, InetAddress bindTo, int port, ThreadPool tp) {
private Port(String path, InetAddress bindTo, int port, ThreadPool tp) {
- super(path); this.bindTo = bindTo; this.port = port; this.tp = tp; }
-
- public void changed(Watched w) {
- //Log.warn(this, "Port: noticed change in " + w);
- super.changed(w);
- }
+ super(new File(path), parentLoader);
+ this.bindTo = bindTo; this.port = port; this.tp = tp; }
void dispatch(final Connection conn) throws Exception {
tp.appendTask(new Runnable() { public void run() {
String local = conn.getLocalAddress() + ":" + conn.getLocalPort();
String remote = conn.getRemoteHostname() + ":" + conn.getRemotePort();
try {
void dispatch(final Connection conn) throws Exception {
tp.appendTask(new Runnable() { public void run() {
String local = conn.getLocalAddress() + ":" + conn.getLocalPort();
String remote = conn.getRemoteHostname() + ":" + conn.getRemotePort();
try {
ServerSocket ss = bindTo == null ? new ServerSocket(port) : new ServerSocket(port, 0, bindTo);
for(Socket s = ss.accept(); ; s = ss.accept()) try {
ServerSocket ss = bindTo == null ? new ServerSocket(port) : new ServerSocket(port, 0, bindTo);
for(Socket s = ss.accept(); ; s = ss.accept()) try {
} catch (Exception e) { Log.warn(Port.class, e); }
} catch (Exception e) { Log.error(Port.class, e);
} catch (Throwable t) {
Log.error(this, "serious error, aborting VM");
Log.error(this, t);
} catch (Exception e) { Log.warn(Port.class, e); }
} catch (Exception e) { Log.error(Port.class, e);
} catch (Throwable t) {
Log.error(this, "serious error, aborting VM");
Log.error(this, t);