<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorControlClient/signal(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A13ControlClientC6signalyySSYaKF"
  },
  "title" : "signal(_:)"
}
-->

# signal(_:)

Send a `SIGNAL` command to Tor (control-spec.txt §3.7).

```
func signal(_ signal: String) async throws
```

## Parameters

`signal`

The signal keyword, uppercase.

## Discussion

Raw signal-vocabulary escape hatch. Signals Tor supports
include `RELOAD` (reload torrc), `SHUTDOWN` (graceful exit),
`HALT` (immediate exit), `DUMP` (log state), `DEBUG` (rotate
debug log), `NEWNYM` (rotate circuits), `CLEARDNSCACHE`, and
`HEARTBEAT`.

> Throws: ``doc://Tor/documentation/Tor/TorError/controlProtocolError(code:message:)`` if
> Tor rejects the signal (e.g. unknown keyword, reply 510).

> Note: For the two common signals swift-tor ships with, use
> ``doc://Tor/documentation/Tor/TorControlClient/newIdentity()`` (`NEWNYM`) and ``doc://Tor/documentation/Tor/TorControlClient/shutdown()`` (`SHUTDOWN`)
> instead of typing the keyword by hand.