code: def _recv_all(self, size):
          
          r_buffer = bytes()
          while len(r_buffer) < size:
              r_packet = self._recv(size - len(r_buffer))
              if not r_packet:
                  return None
              r_buffer += r_packet
          return r_buffer
docs: Receive data over current socket, loop until all bytes is receive (avoid TCP frag)
  
          :param size: number of bytes to receive
          :type size: int
          :returns: receive data or None if error
          :rtype: str (Python2) or class bytes (Python3) or None