int port = new Integer( portNum ).intValue(); try { ss = new ServerSocket( port ); } catch( IOException ioe ) { System.out.println( "Can't create server socket on port : " + port ); System.exit( -1 ); }
if( args.length == 1 ) { new ThreadedWebServer( args[0] ).run(); } else { new ThreadedWebServer( "44444" ).run(); }
Socket sock = null; int handlerCount = 0; while( true ) { try { sock = ss.accept(); } catch( IOException ioe ) { System.out.println( "Accept failed" ); System.exit( -1 ); } handlerCount++; new ConnectionHandler( sock, handlerCount ).start(); }