class_docstr: This is an abstract class.  You must derive from this class, and add
  the two methods collect_incoming_data() and found_terminator()
class_docstr_tok: ["This","is","an","abstract","class",".","You","must","derive","from","this","class",",","and","add","the","two","methods","collect_incoming_data","(",")","and","found_terminator","(",")"]
code: def handle_read(self):
      try:
          data = self.recv(self.ac_in_buffer_size)
      except BlockingIOError:
          return
      except OSError:
          self.handle_error()
          return
  
      if isinstance(data, str) and self.use_encoding:
          data = bytes(str, self.encoding)
      self.ac_in_buffer = self.ac_in_buffer + data
  
      # Continue to search for self.terminator in self.ac_in_buffer,
      # while calling self.collect_incoming_data.  The while loop
      # is necessary because we might read several data+terminator
      # combos with a single recv(4096).
  
      while self.ac_in_buffer:
          lb = len(self.ac_in_buffer)
          terminator = self.get_terminator()
          if not terminator:
              # no terminator, collect it all
              self.collect_incoming_data(self.ac_in_buffer)
              self.ac_in_buffer = b""
          elif isinstance(terminator, int):
              # numeric terminator
              n = terminator
              if lb < n:
                  self.collect_incoming_data(self.ac_in_buffer)
                  self.ac_in_buffer = b""
                  self.terminator = self.terminator - lb
              else:
                  self.collect_incoming_data(self.ac_in_buffer[:n])
                  self.ac_in_buffer = self.ac_in_buffer[n:]
                  self.terminator = 0
                  self.found_terminator()
          else:
              # 3 cases:
              # 1) end of buffer matches terminator exactly:
              #    collect data, transition
              # 2) end of buffer matches some prefix:
              #    collect data to the prefix
              # 3) end of buffer does not match any prefix:
              #    collect data
              terminator_len = len(terminator)
              index = self.ac_in_buffer.find(terminator)
              if index != -1:
                  # we found the terminator
                  if index > 0:
                      # don't bother reporting the empty string
                      # (source of subtle bugs)
                      self.collect_incoming_data(
                          self.ac_in_buffer[:index]
                      )
                  self.ac_in_buffer = self.ac_in_buffer[
                      index + terminator_len :
                  ]
                  # This does the Right Thing if the terminator
                  # is changed here.
                  self.found_terminator()
              else:
                  # check for a prefix of the terminator
                  index = find_prefix_at_end(
                      self.ac_in_buffer, terminator
                  )
                  if index:
                      if index != lb:
                          # we found a prefix, collect up to the prefix
                          self.collect_incoming_data(
                              self.ac_in_buffer[:-index]
                          )
                          self.ac_in_buffer = self.ac_in_buffer[-index:]
                      break
                  else:
                      # no prefix, collect it all
                      self.collect_incoming_data(self.ac_in_buffer)
                      self.ac_in_buffer = b""
  
imports: import asyncore
  from collections import deque
  from warnings import _deprecated
label_desc: Use image node_id 8 for calling the async_chat obj's underlying member method code with example usage: obj.handle_read() without return types