vns.backupThread = new Thread(vns.backupThreadRunnable);
vns.backupThread.start();
// Start accepting connections and processing stuff
Debug.p("Serving on port : " + vns.port);
BaseServer server = null;
if (bindAddress != null) {
server = new BaseServer(vns) {
protected ServerSocket createServerSocket(int port) throws IOException {
return new ServerSocket(port, backlog, InetAddress.getByName(bindAddress));
}
};
} else {
server = new BaseServer(vns) {
protected ServerSocket createServerSocket(int port) throws IOException {
return new ServerSocket(port, backlog);
}
};
}
server.setSocketTimeout(5000);
exitThread exitT = new exitThread(server);
exitT.start();
try {
server.setThreadPoolSize(5, maxThreads);
server.serve(vns.port);
} catch (Throwable e) {
Debug.reportException(e);
} finally {
Debug.p("Exiting.");
System.exit(0);