|
| Barracuda.Distributor | | Maintainer | Henning Guenther, Martin Wegner |
|
|
|
| Description |
| This is the main component of Barracuda. It contains the logic of messages flow in
the application. In this case, 'message' does means DistributorMsgs rather than
only protocol messages.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| data DistributorMsg |
| The Distributor is mainly controlled via distributor messages. They can be created
and be given to the processMessage function to be processed on the ServerState.
| | Constructors | | ProtMsg SockAddr String | A message received from the network.
| | NewGUI UserID Certificate PrivateKey (ControlResponse -> IO ()) | Signals that a new GUI was created.
| | GUIMsg UserID ControlMessage | ControlMessages from one of the connected GUIs.
| | TimeMsg | A timer message constantly pinging the Distributor to trigger certain periodic actions like sending HELLOs, etc.
| | InfraMsg (Maybe (Set SockAddr)) | A message containing a set of SockAddresses being the list of known peers. Used for infrastructure mode.
|
|
|
|
| type DistributorChan = Chan (UTCTime, DistributorMsg) |
| Through this channel the Distributor receives the DistributorMsgs.
|
|
| processMessage :: DistributorMsg -> ServerMonad () |
| Main routine of the Distributor: processMessage takes a DistributorMsg and processes it.
This includes: Periodic sending of HELLOs and ROUTINGs triggered by timer messages,
processing all received protocol messages and updating the stored information about the network
in the ServerState respectively sending further messages (e. g. to the remaining non-local receivers).
And additionally it connects the protocol backend of the program to the connected GUIs. Local users
are registered to the Distributor, and the Distributor distributes all incoming messages for local users
to those connected users respectively taking messages from them to be sent to the network.
|
|
| Produced by Haddock version 0.8 |