6 @brief Collection of routines for an OSRF router.
8 The router receives messages from clients and passes each one to a listener for the
9 targeted service. Where there are multiple listeners for the same service, the router
10 picks one on a round-robin basis. If a message bounces because the listener has died,
11 the router sends it to another listener for the same service, if one is available.
13 The server's response to the client, if any, bypasses the router. If the server needs to
14 set up a stateful session with a client, it does so directly (well, via Jabber). Only the
15 initial message from the client passes through the router.
17 Thus the router serves two main functions:
18 - It spreads the load across multiple listeners for the same service.
19 - It reroutes bounced messages to alternative listeners.
21 It also responds to requests for information about the number of messages routed to
22 different services and listeners.
34 struct osrfRouterStruct;
35 typedef struct osrfRouterStruct osrfRouter;
37 osrfRouter* osrfNewRouter( const char* domain, const char* name, const char* resource,
38 const char* password, int port, osrfStringArray* trustedClients,
39 osrfStringArray* trustedServers );
41 int osrfRouterConnect( osrfRouter* router );
43 void osrfRouterRun( osrfRouter* router );
45 void router_stop( osrfRouter* router );
47 void osrfRouterFree( osrfRouter* router );