# libtmux::test::SocketNamespace

- **Module:** libtmux::test
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/393d4b0ad666f18a6581f1eb281741a75a7503f0/include/libtmux/testing/scoped_server.hpp#L42
- **Page:** https://libtmux.org/en/cxx/latest/reference/libtmux-test-socketnamespace/

Names the private tree, the socket and the `tmux -L` name, so concurrent suites cannot collide and a leftover directory identifies its owner.

`label` reaches the socket path, which must fit in `sockaddr_un::sun_path` — 108 bytes on Linux, 104 on macOS. Keep it under about twenty characters: macOS spends roughly sixty of those on `$TMPDIR` alone, once `/var/folders/...` has canonicalised to `/private/var/...`, and tmux spends more again on the directory it puts the socket in. A label that overruns is reported by tmux as "File name too long", naming the path.

`start` refuses one containing anything outside `[A-Za-z0-9._-]`.

## Members

- `label` (attribute)
- `internal` (method)
- `consumer` (method): Prefixed, so a consumer's servers are distinguishable from this library's.
