adhoc-network-1.0.2: Ad-hoc P2P network protocolSource codeContentsIndex
MaintainerStephan Friedrichs, Henning Guenther
class RoutingStrategy rs where
routeSingle :: UserID -> rs -> Maybe SockAddr
routeMulti :: [UserID] -> rs -> (Map SockAddr [UserID], [UserID])
class Addressed a where
route :: RoutingStrategy r => r -> a -> (Map SockAddr a, Maybe a)
class RoutingStrategy rs whereSource
This class abstracts routing strategies for data-structures like Barracuda.RoutingTable.SimpleRT. Minimal definition: one of routeSingle or routeMulti.
routeSingle :: UserID -> rs -> Maybe SockAddrSource
Tries to find a route for a given user. The SockAddr is the starting point of the route.
routeMulti :: [UserID] -> rs -> (Map SockAddr [UserID], [UserID])Source
Find routes for many users. The first object in the tuple maps nodes to a list of users that should be reached over it. The second one is a list of users that couldn't be reached.
class Addressed a whereSource
Abstracts addressed contents that can be sent to (several) users.
:: RoutingStrategy r
=> rThe RoutingStrategy to locate users.
-> aThe data to be routed.
-> (Map SockAddr a, Maybe a)Starting-points and target-data of routes and, optionally, an addressed, failed-to-route datagram.
Routes an Addressed datagram.
show/hide Instances
Produced by Haddock version 2.4.2