try {
    ServerSocket skServidor = new ServerSocket( port );
	System.out.println("[log: System armed on port "+port+"]");

	while (1==1) {
		Socket skCliente = skServidor.accept();
		System.out.println("[log: Connection accepted]");

		connect( skCliente ); 
		}
} catch( Exception ex ) { ex.printStackTrace(); }

/* Here what you want to do with new connection */
protected void connect( Socket skCliente ) {  }