package for one-server-many-clients network comms?

A

Andrew E

Hi all,

The app I'm working on needs to have some simple network comms in it.
I've got a basic thing going where every connection gets a thread, etc, and it
works ok with some simple IO.

But what I want is a bit of handshaking at the front (login, etc), then
broadcast of update events.

I'm thinking messages will look something like:

[length] [typecode] [payload]

where
- length might be a 4 byte integer
- typecode might be 'S' for serialized java object, 'a' for a
string, 'x' for xml etc

I'd like to use nio even though I probably won't need the scalability.


There *must* be some good ready-to-run code out there for a reactor pattern with
some basic protocol handling stuff, ready to go, out of the box.

Some googling turned up lots of echo servers, but nothing a bit higher level
like this. This would be a bit like the python 'twisted' package but for Java.

Any tips warmly appreciated :)

Andrew
 
B

bartekkl

Hello, Andrew -

Why not start with RMI? It seems that it will allow for any of your
requirements, and additionally you can build with it an application
that can be easily maintained and extended. AFAIK you can use RMI with
SSL if security is an issue.

Another option might be JMS - the server publishes a single message to
a "topic", and multiple clients read the message from the topic. This
is probably the most extensible solution for your problem. It involves
some learning and setup, but relatively little coding.
A noteworthy feature of JMS is that it is scalable, it has an open,
widely accepted API, and you can replace the implementation of JMS with
a more powerful one at any time, if needed.

Regards,

Bartek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top