code: def connect(self):
          
          self.end_live_capture = False
          if not self.ommit_ping and not self.helper.test_ping():
              raise ZKNetworkError("can't reach device (ping %s)" % self.__address[0])
          if not self.force_udp and self.helper.test_tcp() == 0:
              self.user_packet_size = 72 # default zk8
          self.__create_socket()
          self.__session_id = 0
          self.__reply_id = const.USHRT_MAX - 1
          cmd_response = self.__send_command(const.CMD_CONNECT)
          self.__session_id = self.__header[2]
          if cmd_response.get('code') == const.CMD_ACK_UNAUTH:
              if self.verbose: print ("try auth")
              command_string = make_commkey(self.__password, self.__session_id)
              cmd_response = self.__send_command(const.CMD_AUTH, command_string)
          if cmd_response.get('status'):
              self.is_connect = True
              return self
          else:
              if cmd_response["code"] == const.CMD_ACK_UNAUTH:
                  raise ZKErrorResponse("Unauthenticated")
              if self.verbose: print ("connect err response {} ".format(cmd_response["code"]))
              raise ZKErrorResponse("Invalid response: Can't connect")
docs: connect to the device
  
          :return: bool