code: def reconnect(self):
          
          self._converters.clear()
          self._gateway = None
          self._xsltFactory = None
          try:
              # print("Starting Java gateway on port: %s" % self._gwPort)
              self._gateway = JavaGateway(GatewayClient(port=self._gwPort))
              self._xsltFactory = self._gateway.jvm.org.pyjxslt.XSLTTransformerFactory('')
              self._refresh_converters()
          except (socket.error, Py4JNetworkError) as e:
              print(e)
              self._gateway = None
              return False
          return True
docs: (Re)establish the gateway connection
          @return: True if connection was established