Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Andrew E - 04 Dec 2005 21:52 GMT
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
bartekkl@gmail.com - 05 Dec 2005 12:08 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.