IterativeStart.java

package fr.umlv.ji.tcp.server.daytime;
import java.util.prefs.*;
import java.util.logging.*;
import fr.umlv.ji.tcp.server.*;
import java.net.*;
import java.io.*;
public class IterativeStart {
  public final static int DEFAULT_PORT = 13;
  public static void main(String[] args) {
    Logger logger =
      Logger.getLogger("fr.umlv.ji.tcp.server.daytime.IterativeStart");
    try {
      Preferences prefs =
    Preferences.userNodeForPackage(
            fr.umlv.ji.tcp.server.daytime.IterativeStart.class);
      Iterative server = new Iterative(logger,prefs);
      server.setService(new DaytimeService(server));
      InetSocketAddress localAddress =
    new InetSocketAddress(prefs.getInt("port",DEFAULT_PORT));
      server.setLocalAddress(localAddress);
      server.launch();
    } catch (Exception e) {
      logger.log(Level.SEVERE,"Erreur au démarrage du serveur",e);
      System.err.println("Erreur au démarrage du serveur :");
      e.printStackTrace(System.err);
    }
  }
}