When the TransmitFile request completes, the socket handle can be passed to theįunction call previously used to establish the connection, such as AcceptEx or ConnectEx. This flag is valid only if TF_DISCONNECT is also specified. Start a transport-level disconnect after all the file data has been queued for transmission. The dwFlags parameter can contain a combination of the following options defined in the Mswsock.h header file: Flag This parameter should be set to a NULL pointer if you want to transmit only the file data.Ī set of flags used to modify the behavior of the TransmitFile function call. TRANSMIT_FILE_BUFFERS data structure that contains pointers to data to send before and after the file data is sent. Windows will set the event specified by the hEvent member of the OVERLAPPED structure, or the socket specified by hSocket, to the signaled state upon completion of the data transmission request. This enables the caller to continue processing while the file transmission operation completes. TransmitFile function returns FALSE, and WSAGetLastError returns ERROR_IO_PENDING or WSA_IO_PENDING. When the lpOverlapped is not NULL, the overlapped I/O might not finish before If lpOverlapped is a NULL pointer, the transmission of data always starts at the current byte offset in the file. You can use the lpOverlapped parameter to specify a 64-bit offset within the file at which to start the file data transfer by setting the Offset and OffsetHigh member of the OVERLAPPED structure. By default, socket handles are opened as overlapped. If the socket handle has been opened as overlapped, specify this parameter in order to achieve an overlapped (asynchronous) I/O operation. The nNumberOfBytesPerSend parameter is useful for protocols that have limitations on the size of individual send requests. To select the default send size, set this parameter to zero. This parameter is used by Windows' sockets layer to determine the block size for send operations. The size, in bytes, of each block of data sent in each send operation. Set this parameter to zero in order to transmit the entire file. TransmitFile function completes when it has sent the specified number of bytes, or when an error occurs, whichever occurs first. The number of bytes in the file to transmit. Any additional action, such as socket disconnect or reuse, is performed as specified by the dwFlags parameter. If the hFile parameter is NULL, only data in the header and/or the tail buffer is transmitted. Since the operating system reads the file data sequentially, you can improve caching performance by opening the handle with FILE_FLAG_SEQUENTIAL_SCAN. The socket specified by the hSocket parameter must be a connection-oriented socket of type SOCK_STREAM, SOCK_SEQPACKET, or SOCK_RDM. TransmitFile function will transmit the file data over this socket. LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |