parameters: (self)
docstring: Closes any persistent/open connections
docstring_summary: Closes any persistent/open connections
docstring_tokens: Closes any persistent / open connections
function: def close(self):
          """
          Closes any persistent/open connections
          """
  
          closed = False
          changed_state_back = False
  
          if self.tcp_connection:
              wininet.InternetCloseHandle(self.tcp_connection)
              self.tcp_connection = None
              closed = True
  
          if self.network_connection:
              wininet.InternetCloseHandle(self.network_connection)
              self.network_connection = None
              closed = True
  
          if self.was_offline:
              dw_connected_state = wintypes.DWORD(self.INTERNET_STATE_DISCONNECTED_BY_USER)
              dw_flags = wintypes.DWORD(0)
              connected_info = InternetConnectedInfo(dw_connected_state, dw_flags)
              wininet.InternetSetOptionA(None,
                  self.INTERNET_OPTION_CONNECTED_STATE, ctypes.byref(connected_info), ctypes.sizeof(connected_info))
              changed_state_back = True
  
          if self.debug:
              s = '' if self.use_count == 1 else 's'
              console_write(u"WinINet %s Debug General" % self.scheme.upper(), True)
              console_write(u"  Closing connection to %s on port %s after %s request%s" % (
                  self.hostname, self.port, self.use_count, s))
              if changed_state_back:
                  console_write(u"  Changed Internet Explorer back to Work Offline")
  
          self.hostname = None
          self.port = None
          self.scheme = None
          self.use_count = 0
          self.was_offline = None
function_tokens: def close ( self ) : closed = False changed_state_back = False if self . tcp_connection : wininet . InternetCloseHandle ( self . tcp_connection ) self . tcp_connection = None closed = True if self . network_connection : wininet . InternetCloseHandle ( self . network_connection ) self . network_connection = None closed = True if self . was_offline : dw_connected_state = wintypes . DWORD ( self . INTERNET_STATE_DISCONNECTED_BY_USER ) dw_flags = wintypes . DWORD ( 0 ) connected_info = InternetConnectedInfo ( dw_connected_state , dw_flags ) wininet . InternetSetOptionA ( None , self . INTERNET_OPTION_CONNECTED_STATE , ctypes . byref ( connected_info ) , ctypes . sizeof ( connected_info ) ) changed_state_back = True if self . debug : s = '' if self . use_count == 1 else 's' console_write ( u"WinINet %s Debug General" % self . scheme . upper ( ) , True ) console_write ( u"  Closing connection to %s on port %s after %s request%s" % ( self . hostname , self . port , self . use_count , s ) ) if changed_state_back : console_write ( u"  Changed Internet Explorer back to Work Offline" ) self . hostname = None self . port = None self . scheme = None self . use_count = 0 self . was_offline = None