~singpolyma/network-protocol-xmpp

baddb8f817260285a43e3b06c5beeb48f17c7fe3 — Sergei Trofimovich 11 years ago 905f103
Fixes example bot running on openfire, which requires
bind fist (as original comment says).
1 files changed, 3 insertions(+), 4 deletions(-)

M examples/echo.hs
M examples/echo.hs => examples/echo.hs +3 -4
@@ 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