SG,
I am not sure if this is what you are talking about, but I created a
"serializable" input stream. How it works:
It starts a listening socket in the originating vm (on a default port or
there is an xml configuration file)
You construct this object with a regular input stream
It puts that in a table with a randomly generated number (will
eventually use some type of signed number for security)
The information that is serialized is the host, port and key
On the other side, the stream connects to the server and starts passing
bytes through to whoever calls it there
The server accepts the connection and ties it off to the originally
passed in stream
to use it, you simply constuct a SerializableInputStream with the
original stream as an argument, then pass it to the other VM. After
that, use it just like any other stream. You could even pass another
one in the other direction (if you had both vm's on the same machine,
you would have to use a different port for the server).
I use it to download images and streaming video from my database
(accessible by the ejb layer only) directly to the client (through the
jsp layer) so that I don't have to allocate the bytes at each step of
the way. Works like a charm for that.
I have attached the source. It uses the xerces xml stuff (which I
believe is packaged with jonas), but you could easily modify the code to
remove that stuff. You use it or modify it any way you want...
Though I have only tried it in plain java rmi, I see no reason why it
wouldn't work in any platform where you can serialize java objects.
John
SG wrote:
> Is it possible to send output/input streams that the client and server
> can listen to? I want them to be able to send answers and prompts to
> each other that they each listen to. Does anyone know if this can be
> done?
inetbasics.zip