<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 25, 2013, at 10:08 AM, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Fri, Jan 25, 2013 at 10:03 AM, Nikolay Kim <span dir="ltr"><<a href="mailto:fafhrd91@gmail.com" target="_blank">fafhrd91@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">

<br>
I think Transport needs 'sendfile' api, something like:<br>
<br>
   @tasks.coroutine<br>
   def sendfile(self, fd, offset, nbytes):<br>
      ….<br>
<br>
otherwise it is impossible to implement sendfile without breaking transport encapsulation</blockquote><div> </div></div>Really? Can't the user write this themselves? What's wrong with this:<br><br>while True:<br>

  data = os.read(fd, 16*1024)<br>  if not data: break<br>  transport.write(data)<br><br>(Perhaps augmented with a way to respond to pause() requests.)<br clear="all"><br></blockquote><div><br></div><div><div>i mean 'os.sendfile()', zero-copy sendfile.</div><div><br></div></div></div></body></html>