# SocketAdapter::DispatchScope

<a id="dispatchscope"></a>

# DispatchScope

```cpp
#include <icy/net/socketadapter.h>

struct DispatchScope
```

[Defined in src/net/include/icy/net/socketadapter.h:146](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/socketadapter.h#L146)

Defers receiver cleanup while any onSocketXxx dispatch loop is on the stack, so re-entrant callbacks cannot shrink `_receivers` under it.

## Public Attributes

| Return | Name | Description |
|--------|------|-------------|
| [`SocketAdapter`](https://auscaster.com/icey/docs/api-reference/icy-net-SocketAdapter.md#socketadapter) * | [`self`](#self)  |  |

---

<a id="self"></a>

### self

```cpp
SocketAdapter * self
```

Type: [`SocketAdapter`](https://auscaster.com/icey/docs/api-reference/icy-net-SocketAdapter.md#socketadapter) *

[Defined in src/net/include/icy/net/socketadapter.h:148](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/socketadapter.h#L148)

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
|  | [`DispatchScope`](#dispatchscope-1) `inline` `explicit` |  |
|  | [`~DispatchScope`](#dispatchscope-2) `inline` |  |

---

<a id="dispatchscope-1"></a>

### DispatchScope

`inline` `explicit`

```cpp
inline explicit DispatchScope(SocketAdapter * adapter)
```

[Defined in src/net/include/icy/net/socketadapter.h:149](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/socketadapter.h#L149)

---

<a id="dispatchscope-2"></a>

### ~DispatchScope

`inline`

```cpp
inline ~DispatchScope()
```

[Defined in src/net/include/icy/net/socketadapter.h:153](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/socketadapter.h#L153)
