You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
539 B
17 lines
539 B
|
13 years ago
|
{-# OPTIONS_HADDOCK hide #-}
|
||
|
13 years ago
|
module Network.Xmpp.Concurrent.Basic where
|
||
|
13 years ago
|
|
||
|
|
import Control.Concurrent.STM
|
||
|
13 years ago
|
import Network.Xmpp.Concurrent.Types
|
||
|
13 years ago
|
import Network.Xmpp.Types
|
||
|
|
|
||
|
|
-- | Send a stanza to the server.
|
||
|
13 years ago
|
sendStanza :: Stanza -> Session -> IO ()
|
||
|
13 years ago
|
sendStanza a session = atomically $ writeTChan (outCh session) a
|
||
|
|
|
||
|
13 years ago
|
-- | Create a new session object with the inbound channel duplicated
|
||
|
|
dupSession :: Session -> IO Session
|
||
|
|
dupSession session = do
|
||
|
|
stanzaCh' <- atomically $ dupTChan (stanzaCh session)
|
||
|
|
return $ session {stanzaCh = stanzaCh'}
|