send host events when server hosts are connected and disconnected (#496)

This commit is contained in:
Evgeny Poberezkin
2022-08-13 11:57:36 +01:00
committed by GitHub
parent 68138c08d2
commit 02bba01c16
10 changed files with 145 additions and 64 deletions
+2 -2
View File
@@ -162,8 +162,8 @@ getSMPServerClient' ca@SMPClientAgent {agentCfg, smpClients, msgQ} srv =
connectClient :: ExceptT ProtocolClientError IO SMPClient
connectClient = ExceptT $ getProtocolClient srv (smpCfg agentCfg) (Just msgQ) clientDisconnected
clientDisconnected :: IO ()
clientDisconnected = do
clientDisconnected :: SMPClient -> IO ()
clientDisconnected _ = do
removeClientAndSubs >>= (`forM_` serverDown)
logInfo . decodeUtf8 $ "Agent disconnected from " <> showServer srv