---
name: "ACE_WIN32_Asynch_Read_Stream_Result"
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_Read_Stream_Result"
---

# ACE\_WIN32\_Asynch\_Read\_Stream\_Result(3)

This is class provides concrete implementation for ACE\_Asynch\_Read\_Stream::Result class.

## NAME

ACE\_WIN32\_Asynch\_Read\_Stream\_Result -

This is class provides concrete implementation for ACE\_Asynch\_Read\_Stream::Result class.

## SYNOPSIS

```
class ACE_WIN32_Asynch_Read_Stream_Result :
  public virtual ACE_Asynch_Read_Stream_Result_Impl,
  public virtual ACE_WIN32_Asynch_Result
{
  public:
    friend class ACE_WIN32_Asynch_Read_Stream;
    friend class ACE_WIN32_Proactor;
    u_long bytes_to_read (void) const;
    ACE_Message_Block &message_block (void) const;
    ACE_HANDLE handle (void) const;
    u_long bytes_transferred (void) const;
    const void *act (void) const;
    int success (void) const;
    const void *completion_key (void) const;
    u_long error (void) const;
    ACE_HANDLE event (void) const;
    u_long offset (void) const;
    u_long offset_high (void) const;
    int priority (void) const;
    int signal_number (void) const;
    int post_completion (ACE_Proactor_Impl *proactor);
  protected:
    ACE_WIN32_Asynch_Read_Stream_Result (
        ACE_Handler &handler,
        ACE_HANDLE handle,
        ACE_Message_Block &message_block,
        u_long bytes_to_read,
        const void* act,
        ACE_HANDLE event,
        int priority,
        int signal_number = 0
        );
    virtual void complete (
        u_long bytes_transferred,
        int success,
        const void *completion_key,
        u_long error
        );
    virtual ~ACE_WIN32_Asynch_Read_Stream_Result (void);
    u_long bytes_to_read_;
    ACE_Message_Block &message_block_;
    ACE_HANDLE handle_;
};
```

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

```
friend class ACE_WIN32_Asynch_Read_Stream;
```

Factory class will have special permissions.

```
friend class ACE_WIN32_Proactor;
```

Proactor class has special permission.

```
u_long bytes_to_read (void) const;
```

The number of bytes which were requested at the start of the asynchronous read.

```
ACE_Message_Block &message_block (void) const;
```

Message block which contains the read data.

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

I/O handle used for reading.

```
u_long bytes_transferred (void) const;
```

Number of bytes transferred by the operation.

```
const void *act (void) const;
```

ACT associated with the operation.

```
int success (void) const;
```

Did the operation succeed?

```
const void *completion_key (void) const;
```

This returns the ACT associated with the handle when it was registered with the I/O completion port.  This ACT is not the same as the ACT associated with the asynchronous operation.

```
u_long error (void) const;
```

Error value if the operation fail.

```
ACE_HANDLE event (void) const;
```

Event associated with the OVERLAPPED structure.

```
u_long offset (void) const;
```

This really make sense only when doing file I/O.

```
u_long offset_high (void) const;
```

Offset\_high associated with the OVERLAPPED structure.

```
int priority (void) const;
```

The priority of the asynchronous operation. Currently, this is not supported on Win32.

```
int signal_number (void) const;
```

No-op. Returns 0.

```
int post_completion (ACE_Proactor_Impl *proactor);
```

Post this to the Proactor's completion port.

## PROTECTED MEMBERS

```
ACE_WIN32_Asynch_Read_Stream_Result (
    ACE_Handler &handler,
    ACE_HANDLE handle,
    ACE_Message_Block &message_block,
    u_long bytes_to_read,
    const void* act,
    ACE_HANDLE event,
    int priority,
    int signal_number = 0
    );
```

Constructor is protected since creation is limited to ACE\_Asynch\_Read\_Stream factory.

```
virtual void complete (
    u_long bytes_transferred,
    int success,
    const void *completion_key,
    u_long error
    );
```

Proactor will call this method when the read completes.

```
virtual ~ACE_WIN32_Asynch_Read_Stream_Result (void);
```

Destructor.

```
u_long bytes_to_read_;
```

Bytes requested when the asynchronous read was initiated.

```
ACE_Message_Block &message_block_;
```

Message block for reading the data into.

```
ACE_HANDLE handle_;
```

I/O handle used for reading.

## AUTHOR

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

## LIBRARY

ace
