TransmitFile(Socket, File, NumberOfBytesToWrite, NumberOfBytesPerSend, Overlapped, Flags, Head, Tail)

Transmits a file over a socket TransmitFile(sock, filehandle, bytes_to_write, bytes_per_send, overlap, flags [, (prepend_buf, postpend_buf)])


Socket : PySocket /int

Socket that will be used to send the file

File : PyHANDLE/int

Handle to the file

NumberOfBytesToWrite : int

The number of bytes in the file to transmit, use 0 for entire file.

NumberOfBytesPerSend : int

The size, in bytes, of each block of data sent in each send operation.

Overlapped : PyOVERLAPPED

An overlapped structure, can be None.

Flags : int

A set of flags used to modify the behavior of the TransmitFile function call. (win32file.TF_*)

Head=None : buffer

Buffer to send on the socket before the file

Tail=None : buffer

Buffer to send on the socket after the file

Return Value

Returns 0 on completion, or ERROR_IO_PENDING if an overlapped operation has been queued