title: Need to close python socket / Find the current running server on my dev environment
body: <p>I'm trying to learn python (using the Flask micro-framework) and I am confused because somewhere in my code i'm keeping the server open I believe.</p>
  
  <p>I spin up my server with 'python app.py' and then close it however.... it still lives!</p>
  
  <p>I'm not sure how this is possible but i must have done something wrong with a connection.</p>
  
  <p>There are two questions here really. </p>
  
  <p><strong>First: How can I find the active connection/socket and close it</strong></p>
  
  <p><strong>Second: Is there a way I can diagnose what is having an open connection, my hunch is that sqlLite is not closing as it is the last thing I implemented.</strong> </p>
  
  <p>This is a one file application (minus a config file and static content) so I can post the code if required.</p>
  
  <p>Error generated (Folder locations changed):</p>
  
  <pre><code>/Development/flask_projects/test_email/env/bin/python /Development/flask_projects/test_email/app.py
   * Running on http://127.0.0.1:5000/
  Traceback (most recent call last):
    File "Development/flask_projects/test_email/app.py", line 58, in &lt;module&gt;
      app.run()
    File "Development/flask_projects/wtchn_email/env/lib/python2.7/site-packages/Flask-0.8-py2.7.egg/flask/app.py", line 703, in run
      run_simple(host, port, self, **options)
    File "/Library/Python/2.7/site-packages/Werkzeug-0.7.1-py2.7.egg/werkzeug/serving.py", line 612, in run_simple
      test_socket.bind((hostname, port))
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 48] Address already in use
  </code></pre>