---
name: "ACE_Handle_Gobbler"
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_Handle_Gobbler"
---

# ACE\_Handle\_Gobbler(3)

This class gobbles up handles.

## NAME

ACE\_Handle\_Gobbler -  This class gobbles up handles.

## SYNOPSIS

```
#include <ace/Handle_Gobbler.h>
class ACE_Handle_Gobbler
{
  public:
    inline ~ACE_Handle_Gobbler (void);
    inline int consume_handles (size_t n_handles_to_keep_available);
    inline int free_handles (size_t n_handles);
    inline void close_remaining_handles (void);
  private:
    typedef ACE_Unbounded_Set<ACE_HANDLE> HANDLE_SET;
    HANDLE_SET handle_set_;
};
```

## DESCRIPTION

This is useful when we need to control the number of handles available for a process.  This class is mostly used for testing purposes.

## PUBLIC MEMBERS

```
inline ~ACE_Handle_Gobbler (void);
```

Destructor.  Cleans up any remaining handles.

```
inline int consume_handles (size_t n_handles_to_keep_available);
```

Handles are opened continously until the process runs out of them, and then n\_handles\_to\_keep\_available handles are closed (freed) thereby making them usable in the future.

```
inline int free_handles (size_t n_handles);
```

Free up n\_handles.

```
inline void close_remaining_handles (void);
```

All remaining handles are closed.

## PRIVATE MEMBERS

```
typedef ACE_Unbounded_Set<ACE_HANDLE> HANDLE_SET;
```

```
HANDLE_SET handle_set_;
```

The container which holds the open descriptors.

## AUTHOR

Kirthika Parameswaran kirthika@cs.wustl.edu Irfan Pyarali irfan@cs.wustl.edu

## LIBRARY

ace
