|
|
|
|
-- |
|
|
|
|
|
-- Module: $Header$
|
|
|
|
|
--
|
|
|
|
|
-- Maintainer: info@jonkri.com
|
|
|
|
|
-- Stability: unstable
|
|
|
|
|
-- Portability: portable
|
|
|
|
|
--
|
|
|
|
|
-- This module allows for low-level access to Pontarius XMPP. Generally, the
|
|
|
|
|
-- "Network.Xmpp" module should be used instead.
|
|
|
|
|
--
|
|
|
|
|
-- The 'Connection' object provides the most low-level access to the XMPP
|
|
|
|
|
-- stream: a simple and single-threaded interface which exposes the conduit
|
|
|
|
|
-- 'Event' source, as well as the input and output byte streams. Custom stateful
|
|
|
|
|
-- 'Connection' functions can be executed using 'withConnection'.
|
|
|
|
|
--
|
|
|
|
|
-- The TLS, SASL, and 'Session' functionalities of Pontarius XMPP are built on
|
|
|
|
|
-- top of this API.
|
|
|
|
|
|
|
|
|
|
module Network.Xmpp.Connection
|
|
|
|
|
( Connection(..)
|
|
|
|
|
, ConnectionState(..)
|
|
|
|
|
, ConnectionHandle(..)
|
|
|
|
|
, ServerFeatures(..)
|
|
|
|
|
, connect
|
|
|
|
|
, withConnection
|
|
|
|
|
, startTls
|
|
|
|
|
, simpleAuth
|
|
|
|
|
, auth
|
|
|
|
|
, pushStanza
|
|
|
|
|
, pullStanza
|
|
|
|
|
, closeConnection
|
|
|
|
|
, newSession
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
where
|
|
|
|
|
|
|
|
|
|
import Network.Xmpp.Connection_
|
|
|
|
|
import Network.Xmpp.Session
|
|
|
|
|
import Network.Xmpp.Tls
|
|
|
|
|
import Network.Xmpp.Types
|
Add limited SourceGraph module imports diagram, remove some imports
In my ongoing "high-level analysis" of Pontarius XMPP, I've proceeded
to take a quick look at the module imports.
The diagram provided is limited in that it does not include the
concurrent implementation, the Sasl modules, the IM modules, the XEP
modules, the example modules, nor the test modules.
Also, Network.Xmpp really does not need Network.Xmpp.Marshal,
Network.Xmpp.Stream, Network.Xmpp.Bind, or Network.Xmpp.Connection_.
Network.Xmpp.Connection does not need Network.Xmpp.Stream either.
These imports, and some others, have been removed with this patch.
Note also that Network.Xmpp.Tls does not need Network.Xmpp.Pickle.
Some observations:
1. There are three simple "utility" modules that depends only on
Network.Xmpp.Types: Utilities, Presence, and Message. Utilities is
inaccessible (indicated by the red colour).
2. There are two exposed "base" modules, Network.Xmpp and
Network.Xmpp.Connection. The former does not need to access
Network.Xmpp.Connection_, while the latter does. Otherwise, they
both import the three modules: Session, Tls, and Types.
Network.Xmpp also import the "utility" modules
Network.Xmpp.Message, Network.Xmpp.Presence, and Network.Xmpp.Jid.
3. In Network.Xmpp.Session, if the `session' function is moved to the
concurrent implementation, we can get rid of a dependency towards
the concurrent implementation in the internal Network.Xmpp modules.
If we take it one step further and also remove the Sasl functions,
we can remove the need for Network.Xmpp to import this module (and
probably get rid of the module completely).
4. Data.Conduit.Tls is only accessed by Network.Xmpp.Tls.
5. Text.Xml.Stream.Elements is only accessed by Network.Xmpp.Stream,
Network.Xmpp.Connection_, and Network.Xmpp.Pickle.
6. Network.Xmpp.Types depends on Network.Xmpp.Jid (and re-exports it).
13 years ago
|
|
|
import Network.Xmpp.Concurrent
|