Methods

Class: SendFile

Uses underling OS sendfile call or a regular memory copy operation if there is no sendfile. You can use this as a WriteAll if you specify the length. Usage:

yield sockets.SendFile(<file handle>, <sock>, 0)
    # will send till send operations return 0

yield sockets.SendFile(<file handle>, <sock>, 0, blocksize=0)
    # there will be only one send operation (if successfull)
    # that meas the whole file will be read in memory if there is no sendfile

yield sockets.SendFile(<file handle>, <sock>, 0, <file size>)
    # this will hang if we can't read <file size> bytes from the file

Methods

__init__ (t, file_handle, sock, offset=None, length=None, blocksize=4096, **kws)

run (t)