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 SimpleWebServer( args[0] ).run(); } else { new SimpleWebServer( "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 ).run(); }