Instance Method
sendRaw(_:)
Escape-hatch: send an arbitrary control command and return the concatenated reply body.
func sendRaw(_ line: String) async throws -> String
Parameters
-
line
-
The command body, without CRLF terminator.
Return Value
The reply lines joined with \n.
Mentioned In
Discussion
Intended for control commands swift-tor has not yet modelled (e.g. HSFETCH, MAPADDRESS, DROPTIMEOUTS). The response lines are joined with \n for consumer convenience.
Throws
TorError.ioError(_:) on transport failure.
Important
Does not classify success vs failure. Callers must inspect the returned string (or the underlying sendCommand(_:)) and react appropriately. Prefer the typed methods (getInfo(_:), signal(_:), etc.) whenever one exists.