## NAME

ACE_WIN32_Asynch_Transmit_File -

This class is a factory for starting off asynchronous transmit files on a stream.

## SYNOPSIS

    class ACE_WIN32_Asynch_Transmit_File :
      public virtual ACE_Asynch_Transmit_File_Impl,
      public ACE_WIN32_Asynch_Operation
    {
      public:
        ACE_WIN32_Asynch_Transmit_File (
            ACE_WIN32_Proactor *win32_proactor
            );
        int transmit_file (
            ACE_HANDLE file,
            ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
            u_long bytes_to_write,
            u_long offset,
            u_long offset_high,
            u_long bytes_per_send,
            u_long flags,
            const void *act,
            int priority,
            int signal_number = 0
            );
        ~ACE_WIN32_Asynch_Transmit_File (void);
        int open (
            ACE_Handler &handler,
            ACE_HANDLE handle,
            const void *completion_key,
            ACE_Proactor *proactor
            );
        int cancel (void);
        ACE_Proactor* proactor (void) const;
    };

## DESCRIPTION

These classes only works on Win32 platforms.

The implementation of `ACE_Asynch_Transmit_File` and `ACE_Asynch_Accept` are only supported if ACE_HAS_WINSOCK2 is defined or you are on WinNT 4.0 or higher.

## PUBLIC MEMBERS

    ACE_WIN32_Asynch_Transmit_File (ACE_WIN32_Proactor *win32_proactor);

Constructor.

    int transmit_file (
        ACE_HANDLE file,
        ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
        u_long bytes_to_write,
        u_long offset,
        u_long offset_high,
        u_long bytes_per_send,
        u_long flags,
        const void *act,
        int priority,
        int signal_number = 0
        );

This starts off an asynchronous transmit file. The `file` is a handle to an open file. `header_and_trailer` is a pointer to a data structure that contains pointers to data to send before and after the file data is sent. Set this parameter to 0 if you only want to transmit the file data. Upto `bytes_to_write` will be written to the `socket`. If you want to send the entire file, let `bytes_to_write` = 0. `bytes_per_send` is the size of each block of data sent per send operation. Please read the Win32 documentation on what the flags should be.

    ~ACE_WIN32_Asynch_Transmit_File (void);

Destructor.

    int open (
        ACE_Handler &handler,
        ACE_HANDLE handle,
        const void *completion_key,
        ACE_Proactor *proactor
        );

Initializes the factory with information which will be used with each asynchronous call. If (`handle` == ACE_INVALID_HANDLE), `ACE_Handler::handle` will be called on the `handler` to get the correct handle.

    int cancel (void);

This cancels all pending accepts operations that were issued by the calling thread. The function does not cancel asynchronous operations issued by other threads.

    ACE_Proactor* proactor (void) const;

Return the underlying proactor.

## AUTHOR

Irfan Pyarali (irfan@cs.wustl.edu), Tim Harrison (harrison@cs.wustl.edu) and Alexander Babu Arulanthu `alex@cs.wustl.edu`

## LIBRARY

ace