| Safe Haskell | Safe-Infered |
|---|
Hbro.Socket
- openRepSocket :: Context -> String -> (Socket Rep -> IO ()) -> IO ()
- listenToCommands :: Environment -> CommandsMap -> Socket Rep -> IO ()
- closeSocket :: Context -> String -> IO ()
- socketFile :: String -> String -> String
- sendCommand :: Context -> String -> String -> IO String
- sendCommandToAll :: Context -> FilePath -> String -> IO [String]
- defaultCommandsList :: CommandsList
Documentation
openRepSocket :: Context -> String -> (Socket Rep -> IO ()) -> IO ()Source
Create a response socket to listen for commands. Loops on listenToSocket until Quit command is received.
listenToCommands :: Environment -> CommandsMap -> Socket Rep -> IO ()Source
Listen for incoming requests from response socket. Parse received commands and feed the corresponding callback, if any.
closeSocket :: Context -> String -> IO ()Source
Close the response socket by sending it the command QUIT. Typically called when exiting application.
socketFile :: String -> String -> StringSource
Return the socket path to use for the given browser's process ID.
sendCommand :: Context -> String -> String -> IO StringSource
Send a single command (through a Request socket) to the given Response socket, and return the answer.
sendCommandToAll :: Context -> FilePath -> String -> IO [String]Source
Same as sendCommand, but for all running instances of the browser.
defaultCommandsList :: CommandsListSource
List of default supported requests.