# control.ControlEvents.shutdown

- **Module:** control.ControlEvents
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/control.rs#L1038
- **Page:** https://libtmux.org/reference/rs/control-controlevents-shutdown/

```
control.ControlEvents.shutdown(mut) -> Result<(), Error>
```

End the connection and report how it went.

The stream running out says only that the connection is over. This says
why, which is the difference between a session that ended and a pipe
that broke. It ends the connection outright rather than waiting for the
senders, so it is the same call whether the connection is still healthy
or tmux hung up an hour ago.

# Errors

Returns an error when the connection failed before it was closed.
