Browse Source

add waitForStream

master
Philipp Balzarek 13 years ago
parent
commit
5831a7b42f
  1. 9
      source/Network/Xmpp/Concurrent/Basic.hs

9
source/Network/Xmpp/Concurrent/Basic.hs

@ -51,3 +51,12 @@ getFeatures :: Session -> IO StreamFeatures @@ -51,3 +51,12 @@ getFeatures :: Session -> IO StreamFeatures
getFeatures Session{streamRef = st} = do
s <- atomically $ readTMVar st
withStream' (gets streamFeatures) s
waitForStream :: Session -> IO ()
waitForStream Session{streamRef = sr} = atomically $ do
s <- readTMVar sr
ss <- readTMVar $ unStream s
case streamConnectionState ss of
Plain -> return ()
Secured -> return ()
_ -> retry

Loading…
Cancel
Save