Browse Source

add port argument to connect methods

master
Philipp Balzarek 13 years ago
parent
commit
f44596eb98
  1. 5
      source/Network/Xmpp.hs
  2. 6
      source/Network/Xmpp/Monad.hs

5
source/Network/Xmpp.hs

@ -238,13 +238,14 @@ simpleAuth username passwd resource = flip auth resource $ @@ -238,13 +238,14 @@ simpleAuth username passwd resource = flip auth resource $
-- Note that the server might assign a different resource even when we send
-- a preference.
simpleConnect :: HostName -- ^ Target host name
-> PortID
-> Text -- ^ User name (authcid)
-> Text -- ^ Password
-> Maybe Text -- ^ Desired resource (or Nothing to let the server
-- decide)
-> XmppConMonad Jid
simpleConnect host username password resource = do
connect host username
simpleConnect host port username password resource = do
connect host port username
startTLS exampleParams
saslResponse <- simpleAuth username password resource
case saslResponse of

6
source/Network/Xmpp/Monad.hs

@ -138,10 +138,10 @@ xmppNoConnection = XmppConnection @@ -138,10 +138,10 @@ xmppNoConnection = XmppConnection
-- Connects to the given hostname on port 5222 (TODO: Make this dynamic) and
-- updates the XmppConMonad XmppConnection state.
xmppRawConnect :: HostName -> Text -> XmppConMonad ()
xmppRawConnect host hostname = do
xmppRawConnect :: HostName -> PortID -> Text -> XmppConMonad ()
xmppRawConnect host port hostname = do
con <- liftIO $ do
con <- connectTo host (PortNumber 5222)
con <- connectTo host port
hSetBuffering con NoBuffering
return con
let raw = if debug

Loading…
Cancel
Save