+ public static void main(String[] s) throws Exception {
+ new Main().main();
+ }
+
+ public void main() throws Exception {
+ ServerSocket sock143 = new ServerSocket(143);
+ ServerSocket sock119 = new ServerSocket(119);
+ ServerSocket sock25 = new ServerSocket(25);
+ new Acceptor(sock143).start();
+ new Acceptor(sock119).start();
+ new Acceptor(sock25).start();
+ }
+
+ private class Acceptor extends Thread {
+ private ServerSocket ss;
+ public Acceptor(ServerSocket ss) { this.ss = ss; }
+ public void run() {
+ try {
+ while(true) {
+ final Socket s = ss.accept();
+ try {
+ new Thread() {
+ public void run() {
+ try {
+ accept(new Connection(s, "megacz.com"));
+ } catch (Exception e) { Log.error(Main.class, e); }
+ }
+ }.start();
+ } catch (Exception e) { Log.error(Main.class, e); }
+ }
+ } catch (Exception e) { Log.error(Main.class, e); }
+ }
+ }
+