|
|
|
|
@ -113,7 +113,7 @@ brokerClientThread socketIdentity ctx ep cmd comp killMv secParams logger = fina
@@ -113,7 +113,7 @@ brokerClientThread socketIdentity ctx ep cmd comp killMv secParams logger = fina
|
|
|
|
|
log Debug "Broker.Client" "Connected" |
|
|
|
|
isTimeout <- newIORef False |
|
|
|
|
|
|
|
|
|
whileM_ (andM [isNothing <$> tryReadMVar killMv, (== False) <$> readIORef isTimeout]) $ do |
|
|
|
|
whileM_ (andM [isNothing <$> tryReadMVar killMv, not <$> readIORef isTimeout]) $ do |
|
|
|
|
(request, resp) <- takeMVar cmd |
|
|
|
|
send sock [] (BL.toStrict $ encode request) |
|
|
|
|
incomingMessage <- timeout 5000000 $ receive sock |
|
|
|
|
@ -159,6 +159,7 @@ notificationThread clientIdentity callbacks ctx ep idCounter cmdVar killMv secPa
@@ -159,6 +159,7 @@ notificationThread clientIdentity callbacks ctx ep idCounter cmdVar killMv secPa
|
|
|
|
|
|
|
|
|
|
initialSqnum <- requestCurrentSqnum cmdVar idCounter clientIdentity |
|
|
|
|
|
|
|
|
|
log Debug "Broker.Client" $ "Got current sqnum: " <> (T.pack . show) initialSqnum |
|
|
|
|
notifSqnumRef <- newIORef initialSqnum |
|
|
|
|
whileM_ (isNothing <$> tryReadMVar killMv) $ do |
|
|
|
|
evs <- poll 5000 [Sock sock [In] Nothing] |
|
|
|
|
|