def METHOD_NAME(self, ip, port, filename, status_notify=None, resume=None):
    self.status_notify = status_notify
    self.send_64bits_ack = not self.filesize < 1 << 32
    chunk_name = filename + ".chunk0"
    if resume and os.path.exists(chunk_name):
        self.fh = open(chunk_name, mode="ab")
        resume_position = self.fh.tell()
        if not resume_position:
            resume_position = os.stat(chunk_name).st_size
        resume_position = resume(resume_position)
        self.fh.truncate(resume_position)
        self.received = resume_position
    else:
        self.fh = open(chunk_name, mode="wb")
    last_update = time.time()
    num_recv_len = 0
    self.dccsock = self.create_socket()
    recv_list = [self.dccsock]
    self.dccsock.connect((ip, port))
    self.dccsock.setblocking(False)
    # recv loop for dcc socket
    while True:
        if self.abort:
            self.dccsock.close()
            self.fh.close()
            raise Abort
        fdset = select.select(recv_list, [], [], 0.1)
        if self.dccsock in fdset[0]:
            try:
                data = self.dccsock.recv(16384)
            except socket.error as exc:
                if exc.errno in (errno.EAGAIN, errno.EWOULDBLOCK):
                    continue
                else:
                    raise
            data_len = len(data)
            if (
                data_len == 0
                or self.received + data_len > self.filesize > 0
            ):
                break
            num_recv_len += data_len
            self._write_func(data)
            self._send_ack()
        now = time.time()
        timespan = now - last_update
        if timespan > 1:
            # calc speed once per second, averaging over 3 seconds
            self.speeds[2] = self.speeds[1]
            self.speeds[1] = self.speeds[0]
            self.speeds[0] = num_recv_len // timespan
            num_recv_len = 0
            last_update = now
            self.update_progress()
    self.dccsock.close()
    self.fh.close()
    os.rename(chunk_name, filename)
    return filename