Browse Source

export streamState

master
Philipp Balzarek 12 years ago
parent
commit
9e776a39a6
  1. 1
      source/Network/Xmpp.hs
  2. 6
      source/Network/Xmpp/Concurrent/Basic.hs

1
source/Network/Xmpp.hs

@ -58,6 +58,7 @@ module Network.Xmpp
, closeConnection , closeConnection
, endSession , endSession
, waitForStream , waitForStream
, streamState
-- ** Authentication handlers -- ** Authentication handlers
-- | The use of 'scramSha1' is /recommended/, but 'digestMd5' might be -- | The use of 'scramSha1' is /recommended/, but 'digestMd5' might be
-- useful for interaction with older implementations. -- useful for interaction with older implementations.

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

@ -1,6 +1,7 @@
{-# OPTIONS_HADDOCK hide #-} {-# OPTIONS_HADDOCK hide #-}
module Network.Xmpp.Concurrent.Basic where module Network.Xmpp.Concurrent.Basic where
import Control.Applicative
import Control.Concurrent.STM import Control.Concurrent.STM
import qualified Control.Exception as Ex import qualified Control.Exception as Ex
import Control.Monad.State.Strict import Control.Monad.State.Strict
@ -70,3 +71,8 @@ waitForStream Session{streamRef = sr} = atomically $ do
Plain -> return () Plain -> return ()
Secured -> return () Secured -> return ()
_ -> retry _ -> retry
streamState :: Session -> STM ConnectionState
streamState Session{streamRef = sr} = do
s <- readTMVar sr
streamConnectionState <$> (readTMVar $ unStream s)

Loading…
Cancel
Save