title: Exclusively bind to a port with Jetty
body: <p>Currently we have a Jetty 7 server started this way</p>
  
  <pre><code>//create a new server listening on the 80
  Server server = new Server();
  
  SelectChannelConnector connector = new SelectChannelConnector();
  connector.setReuseAddress(false);
  connector.setPort(80);
  server.setConnectors(new Connector[]{connector});
  
  ...
  server.start();
  </code></pre>
  
  <p>And when there's no other application catching the 80 port, all is fine. I've also ensured that two Instances of Jetty can't start listening on the same port because of the <code>setReuseAddress</code>.</p>
  
  <p>There is however a case when some other application starts listening on port 80 and Jetty server still manages to start (failing to serve connections there). </p>
  
  <pre><code>C:\Users\bacadmin&gt;netstat -anov | find ":80 "
  
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       3976
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       3808
  TCP    [::]:80                [::]:0                 LISTENING       3976
  </code></pre>
  
  <p>How is that possible and what can be done to insure that Jetty gets an exception during startup if the port isn't open.</p>