title: python websocket client connected status - how to update so I get correct status?
body: <p>I am able to connect to a node.js <a href="http://einaros.github.io/ws/" rel="noreferrer">websocket</a> server using <a href="https://github.com/liris/websocket-client" rel="noreferrer">python websocket</a>. When I ask the python websocket client if it is connected to the server, it is not accurate.</p>
  
  <p>Here is what happens:</p>
  
  <pre><code>Python 2.7.6 (default, Sep  9 2014, 15:04:36)
  &gt;&gt;&gt; import websocket
  &gt;&gt;&gt; ws = websocket.WebSocket()
  &gt;&gt;&gt; ws.connect("ws://localhost:8081") # my websocket server is running, so all good here.
  &gt;&gt;&gt; ws.connected
  True      # This is correct. Now I kill the websocker server
  &gt;&gt;&gt; ws.connected
  True      # this should be false since the server is dead.
  </code></pre>
  
  <p>The <a href="http://einaros.github.io/ws/" rel="noreferrer">ws</a> node.js module comes with <code>wscat</code> and you can run a websocket server by the command <code>wscat -l 8081</code>.</p>
  
  <p>How do I get an accurate status that indicates the true connected/disconnected state?</p>