---
name: "ACE_Handler"
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_Handler"
---

# ACE\_Handler(3)

This base class defines the interface for receiving the results of asynchronous operations.

## NAME

ACE\_Handler -  This base class defines the interface for receiving the results of asynchronous operations.

## SYNOPSIS

```
class ACE_Handler
{
  public:
    ACE_Handler (void);
    ACE_Handler (ACE_Proactor *p);
    virtual ~ACE_Handler (void);
    virtual void handle_read_stream (
        const ACE_Asynch_Read_Stream::Result &result
        );
    virtual void handle_write_stream (
        const ACE_Asynch_Write_Stream::Result &result
        );
    virtual void handle_read_file (
        const ACE_Asynch_Read_File::Result &result
        );
    virtual void handle_write_file (
        const ACE_Asynch_Write_File::Result &result
        );
    virtual void handle_accept (
        const ACE_Asynch_Accept::Result &result
        );
    virtual void handle_transmit_file (
        const ACE_Asynch_Transmit_File::Result &result
        );
    virtual void handle_time_out (
        const ACE_Time_Value &tv,
        const void *act = 0
        );
    virtual void handle_wakeup (void);
    ACE_Proactor *proactor (void);
    void proactor (ACE_Proactor *p);
    virtual ACE_HANDLE handle (void) const;
  protected:
    ACE_Proactor *proactor_;
};
```

## DESCRIPTION

This works on Win32 (#if defined (ACE\_WIN32) && !defined (ACE\_HAS\_WINCE)) platforms and on POSIX4 platforms with aio\_\* routines (#if defined (ACE\_HAS\_AIO\_CALLS))

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_Handler (void);
```

A do nothing constructor.

```
ACE_Handler (ACE_Proactor *p);
```

A do nothing constructor which allows proactor to be set to p.

```
virtual ~ACE_Handler (void);
```

Virtual destruction.

```
virtual void handle_read_stream (
    const ACE_Asynch_Read_Stream::Result &result
    );
```

This method will be called when an asynchronous read completes on a stream.

```
virtual void handle_write_stream (
    const ACE_Asynch_Write_Stream::Result &result
    );
```

This method will be called when an asynchronous write completes on a stream.

```
virtual void handle_read_file (
    const ACE_Asynch_Read_File::Result &result
    );
```

This method will be called when an asynchronous read completes on a file.

```
virtual void handle_write_file (
    const ACE_Asynch_Write_File::Result &result
    );
```

This method will be called when an asynchronous write completes on a file.

```
virtual void handle_accept (const ACE_Asynch_Accept::Result &result);
```

This method will be called when an asynchronous accept completes.

```
virtual void handle_transmit_file (
    const ACE_Asynch_Transmit_File::Result &result
    );
```

This method will be called when an asynchronous transmit file completes.

```
virtual void handle_time_out (
    const ACE_Time_Value &tv,
    const void *act = 0
    );
```

Called when timer expires.  tv was the requested time value and act is the ACT passed when scheduling the timer.

```
virtual void handle_wakeup (void);
```

This is method works with the run\_event\_loop of the ACE\_Proactor. A special Wake\_Up\_Completion is used to wake up all the threads that are blocking for completions.

```
ACE_Proactor *proactor (void);
```

Get the proactor associated with this handler.

```
void proactor (ACE_Proactor *p);
```

Set the proactor.

```
virtual ACE_HANDLE handle (void) const;
```

Get the I/O handle used by this handler. This method will be called by the ACE\_Asynch\_\* classes when an ACE\_INVALID\_HANDLE is passed to open.

## PROTECTED MEMBERS

```
ACE_Proactor *proactor_;
```

The proactor associated with this handler.

## AUTHOR

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

## LIBRARY

ace
