users@grizzly.java.net

Using Grizzly with hardware devices?

From: P J <mycaptainmorgan_at_gmail.com>
Date: Mon, 13 Oct 2008 12:23:39 +0200

RE: My question pertains to the use of the Grizzly Framework being used to
communicate with hardware devices.

Hello all,
If this is not the correct way to ask questions, please direct me to the
appropriate forum.


Quick background:

   - The hardware devices are gprs modems, with embedded software(which I do
   not have code access to - so it's a constant) These modems are programmed to
   a very simple protocol, and can perform a few operations.
   - I am tasked to write a central server. The modems will poll my
   software, to which I will echo back... on occasion I will send through an
   operation request(self test, or parameter updates...) and of course receive
   "OKs" back.
   - My server application has to in JAVA.
   - At any point in time I might have to handle hundreds or even thousands
   of connections.
   - Using a blog example(Using Grizzly to read TCP Packets:
<http://gallemore.blogspot.com/2007/07/using-grizzly-to-read-tcp-packets.html>
   http://gallemore.blogspot.com/2007/07/using-grizzly-to-read-tcp-packets.html)

   <http://gallemore.blogspot.com/2007/07/using-grizzly-to-read-tcp-packets.html>I
   got an echo server running successfully - qualify, I'm getting polling
   messages.<http://gallemore.blogspot.com/2007/07/using-grizzly-to-read-tcp-packets.html>
   - I'm a multiple threads programmer... learning the NIO ropes, this all
   is a bit different :-)


My questions are as follow:


   1. Would Grizzly be an appropriate technology for this type of
   application?
   2. It's so difficult to get relevant documentation. Are there any pdf's,
   e-books, printed books that would be beneficial to read?
   3. I've tried expanding the example to use callbacks. (Reason: I might
   send a request to a modem 1, and whilst waiting for the response, need to
   tend to a polling message from modem 2, but once the reply-results arrive, I
   need to know that the message came from modem 1, because the message
   might not carry an identifying id - for example, an OK message has no modem
   ID - this of course is no problem with a 1-to-1 conversation,but with
   thousands it's a nightmare!) :-(


Kind Regards,
Pete