docstr: Return True if the socket is still connected
  to the server, False otherwise.
  
  This check is done in 3 steps:
  1 - Check if we have closed the connection
  2 - Check if the original socket connection failed
  3 - Check if the server has returned any data. If they have,
      assume that the server closed the response after they sent
      the data, i.e. that the data was the HTTP response.
docstr_tok: ["Return","True","if","the","socket","is","still","connected","to","the","server",",","False","otherwise",".","This","check","is","done","in","3","steps",":","1","-","Check","if","we","have","closed","the","connection","2","-","Check","if","the","original","socket","connection","failed","3","-","Check","if","the","server","has","returned","any","data",".","If","they","have",",","assume","that","the","server","closed","the","response","after","they","sent","the","data",",","i.e",".","that","the","data","was","the","HTTP","response","."]
code: def _isconnected(self):
      """Return True if the socket is still connected
      to the server, False otherwise.
  
      This check is done in 3 steps:
      1 - Check if we have closed the connection
      2 - Check if the original socket connection failed
      3 - Check if the server has returned any data. If they have,
          assume that the server closed the response after they sent
          the data, i.e. that the data was the HTTP response.
      """
  
      # 1 - check if we've closed the connection.
      if self._closed:
          return False
  
      # 2 - Check if the original socket connection failed
      # If this failed, then no socket was initialized
      if self._conn.sock is None:
          return False
  
      try:
          # 3 - Check if the server has returned any data.
          # If they have, then start to store the response
          # in _bytes.
          self._bytes = b""
          self._bytes = self._conn.sock.recv(1)
          return False
      except http.client.socket.error as e:
          # Check why recv failed
          # Windows machines are the error codes
          # that start with 1
          # (http://msdn.microsoft.com/en-ca/library/windows/desktop/ms740668(v=vs.85).aspx)
          if e.errno == 35 or e.errno == 10035:
              # This is the "Resource temporarily unavailable" error
              # which is thrown cuz there was nothing to receive, i.e.
              # the server hasn't returned a response yet.
              # This is a non-fatal error and the operation
              # should be tried again.
              # So, assume that the connection is still open.
              return True
          elif e.errno == 54 or e.errno == 10054:
              # This is the "Connection reset by peer" error
              # which is thrown cuz the server reset the
              # socket, so the connection is closed.
              return False
          elif e.errno == 11:
              # This is the "Resource temporarily unavailable" error
              # which happens because the "operation would have blocked
              # but nonblocking operation was requested".
              # We require non-blocking reading of this socket because
              # we don't want to wait around for a response, we just
              # want to see if a response is currently available. So
              # let's just assume that we're still connected and
              # hopefully recieve some data on the next try.
              return True
          elif isinstance(e, ssl.SSLError):
              if e.errno == 2:
                  # errno 2 occurs when trying to read or write data, but more
                  # data needs to be received on the underlying TCP transport
                  # before the request can be fulfilled.
                  #
                  # Python 2.7.9+ and Python 3.3+ give this its own exception,
                  # SSLWantReadError
                  return True
              raise e
          else:
              # Unknown scenario
              raise e
  
imports: import http.client
  import os
  import ssl
  import time
  from io import StringIO
  from urllib.parse import urlparse, unquote
  from chart_studio.api import utils
label_desc: Use image node_id 8 for calling the Stream obj's underlying member method code with example usage: obj._isconnected() and returns: False, False, False, True, False, True, True