public JhttpServer(int port, WebInterface webinterface) {
System.out.println("starting...");
this.webinterface=webinterface;
- try{
+ try {
System.out.println("creating the port");
server = new ServerSocket(port);
- }
- catch (IOException e){
+ } catch (IOException e) {
System.err.println(e);
System.exit(1);
}
public void run() {
// infinite loop
- while (true){
- try{
+ while (true) {
+ try {
startWorker(server.accept());
- }
- catch (Exception e){
+ } catch (Exception e) {
System.err.println(e);
}
}