title: Stopping a JMeter non-gui test that started from Java code
body: <p>I started a <code>JMeter</code> <code>JMX</code> test from <code>Java</code> code:</p>
  
  <pre><code>StandardJMeterEngine jmeter = new StandardJMeterEngine();
  ..
  jmeter.configure(testPlanTree);
  jmeter.run();
  </code></pre>
  
  <p>I would like to be able to stop the test (from outside the test, for example command line), similar to the option if it had run from non-gui mode using (from cmd):</p>
  
  <pre><code>jmeter -n -t MyTest.jmx
  </code></pre>
  
  <p>Stopping with:</p>
  
  <pre><code>shutdown.cmd (/sh)
  stoptest.cmd (/sh)
  </code></pre>
  
  <p>When starting from non-gui cmd, I can see that it waits for signals:</p>
  
  <pre><code>Waiting for possible shutdown message on port 4445
  </code></pre>
  
  <p>If started from my non-gui <code>Java</code> code, it does not listen on this port. How can I add this functionality to this mode? </p>
  
  <p>Any suggestion will be very appreciated?
  Thanks!</p>