---
name: "ACE_WIN32_Asynch_Transmit_File"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_WIN32_Asynch_Transmit_File"
---

# ACE\_WIN32\_Asynch\_Transmit\_File(3)

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

## 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
