SocketCommunicator

interface SocketCommunicator : AutoCloseable

An interface to facilitate communication with signald socket. The implementation might close socket connections after making a request, in which case, the readLine function will not be supported.

Functions

close
Link copied to clipboard
common
abstract fun close()
readLine
Link copied to clipboard
common
abstract fun readLine(): String?
Reads a JSON message from the socket, blocking until a message is received or returning null if the socket closes.
submit
Link copied to clipboard
common
abstract fun submit(request: String): String
Sends the request to the socket as a single line of JSON (line terminated with \n), and returns the JSON response from signald.