@@ 74,16 74,15 @@ runEcho hostname user password = do
-- 'throwError' and 'catchError' computations to handle errors within an XMPP
-- session.
res <- runClient server jid username password $ do
+ -- When running a client session, most servers require the user to
+ -- "bind" their JID before sending any stanzas.
+ boundJID <- bindJID jid
-- Some servers will close the XMPP connection after some period
-- of inactivity. For this example, we'll simply send a "ping" every
-- 60 seconds
getSession >>= liftIO . forkIO . sendPings 60
- -- When running a client session, most servers require the user to
- -- "bind" their JID before sending any stanzas.
- boundJID <- bindJID jid
-
-- 'XMPP' is an instance of 'MonadIO', so any IO may be performed
-- within.
liftIO $ putStrLn $ "Server bound our session to: " ++ show boundJID