package for one-server-many-clients network comms?
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]
- 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 :)
Re: package for one-server-many-clients network comms?
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.
|All times are GMT. The time now is 06:24 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.