Class Main


public class Main extends Object
Entry point for the babel-demo peer-to-peer chat.

The demo composes three Babel protocols and lets the runtime wire them together through asynchronous events:

  1. GossipBasedFullMembership — keeps us connected to the other nodes and finds them automatically (it's a DiscoverableProtocol);
  2. FloodBroadcast — disseminates messages to all neighbours;
  3. ChatApp — the interactive mIRC-style chat on top.

Launch: java -jar babel-demo.jar nick=<name> [babel.port=<port>] [babel.interface=<nic>] [babel.address=<ip>] [membership.contact=<host>:<port>]

  • Field Details

    • PAR_NICK

      public static final String PAR_NICK
      Your chat nickname — how you appear to everyone else. No default: if it is omitted, the launcher prompts for one interactively at startup (when run on a terminal). It must be supplied as nick=<name> only when there is no interactive console (e.g. piped input).
      See Also:
    • PAR_DEFAULT_BABEL_PORT

      public static final String PAR_DEFAULT_BABEL_PORT
      Default value for the TCP port (Babel.PAR_DEFAULT_PORT, i.e. babel.port) this node binds and listens on. Run several nodes on one machine by giving each a distinct port; across machines the same port is fine. babel-core owns the key but defines no default value, so the demo supplies one here.
      See Also:
  • Constructor Details

    • Main

      public Main()
  • Method Details