On Fri, Oct 9, 2009 at 11:17 PM, Les Hazlewood <lhazlew...@apache.org> wrote:
> On Thu, Oct 8, 2009 at 11:49 PM, Ashish <paliwalash...@gmail.com> wrote:
>> A and B connects to Broker
>> After brief chat... negotiate connection details
>> Setup connection
>> once done, signal to initiator to start sending the data on the new channel
>
> Oops - just read this - I can't do it.  Per network security
> restrictions (don't ask - this has been a thorn in my side for almost
> a year), Host A and B are never allowed to communicate with each other
> directly - only via this broker which I'm building.  That's why I'm
> required to do the byte relaying technique.
>
> The broker will eventually be able to intercept the bytes from Host A
> and perform some logic based on the data before sending on to Host B,
> but I want to get the raw stream relay working first before moving on
> to that :)

had a brief look at proxy example code. Its fits in situation.
To make this happen, you will need both Hosts to be connected before
this can happen

so lets walk through this
Broker is up
Host A connects to Broker
Host A session created
Host B connects to Broker
Host B session is created
Can listen for session events and keep a session registry in cache
(ehcache or anything else)
on message received in IoHandler, lookup for appropriate session and
write to it.
All this can happen either in your IoHandler or better have it
delegated within your Broker
If any of then breaks connection, you clean up your session cache and
your broker logic invalidates the connection.

Once basic flow is up, you can plugin your custom manipulation logic :-)

HTH

-- 
thanks
ashish

Reply via email to