# libtmux::Connection::notification_fd

- **Module:** libtmux::Connection
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/85e8bd603a322dc32bb8b9aeb1a72bcf36945f1d/include/libtmux/control.hpp#L264
- **Page:** https://libtmux.org/reference/cxx/libtmux-connection-notification_fd/

```
libtmux::Connection::notification_fd() -> int
```

A descriptor that is readable exactly when a take would return something.

For a caller who owns their own event loop. Without it, integrating means a thread blocked in `wait_for_notifications`, a queue of their own, and a self-pipe to wake the loop — which is this descriptor, rebuilt by hand on top of the thread and queue this connection already has.

Do not read from it: readability is the signal and the byte is this connection's to consume. Drain with `take_notifications`, which clears it. A broken stream makes it readable too, so a poller learns of the failure rather than waiting for an answer that cannot come.

Valid until the connection is destroyed or moved from; `-1` if the pipe could not be created.
