Instance Method
signal(_:)
Send a SIGNAL command to Tor (control-spec.txt §3.7).
func signal(_ signal: String) async throws
Parameters
-
signal
-
The signal keyword, uppercase.
Mentioned In
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
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 newIdentity() (NEWNYM) and shutdown() (SHUTDOWN) instead of typing the keyword by hand.