Raindrop

Push Server

Push Server is socket based line feed push application. It listens for socket connections and then allows user to register for message streams. Once a user has registered the application "pushes" updated content to the user. It is very basic and designed as a test to see how many concurrent connections can be pushed to.

Back to top

Getting Started

Go to the demo/pushserver directory that is inside the dist directory. The following scripts can be run to start the server.

For Windows execute:

demo/pushserver/run.bat

For Linux/Mac OS execute:

demo/pushserver/run.sh

Raindrop will create a very small, lightweight, server running on port 12345.

Once the appropriate script has been executed you can telnet into the application and regsiter for a "stream" as follows:

telnet localhost 12345
Once the connection has been established register by sending:
[STREAM NAME]<CR><LF>
where [STREAM NAME] is the name of the stream you wish to register for.

The following streams are available:

  • date - the current date, updated every second.
  • epoch - the current unix epoch, updated every second.
  • rotating - one of four messages, updated every second.

Back to top

Configuration

The raindrop configuration file is available from:

dist/demo/pushserver/raindrop.xml

The following Handlers are used within the Push server:

com.ewansilver.raindrop.demo.pushserver.MessageGenerator
Instantiates the MessageGenerator's that push new messages onto the "connection" queue. The MessageGenerator looks for all the parameters that start with messagefactory. and assume that the rest of the parameter name is the name of the MessageFactory. The value of the parameter is the fully qualified classname of the MessageFactory to be instantiated.
com.ewansilver.raindrop.demo.pushserver.ConnectionHandler
Maps the inbound socket connections to specific MessageFactories.
com.ewansilver.raindrop.nio.handlers.RequestHandler
The default NIO RequestHandler that is capable of parsing and handling connections from the NIO subsystem.

Back to top


Copyright © 2007, Ewan Silver