I'm looking to implement the SlimProto TCP Protocol using MINA.  It is
documented at http://wiki.slimdevices.com/index.cgi?SlimProtoTCPProtocol.
 I bought a Squeezebox to use as a remote audio player and I would
like to write some software for it as a hobbyist.

I am just trying to create a proxy to act as a middleman between the
SlimServer 6.2.1 (http://www.slimdevices.com/su_downloads.html)
software written primarily in Perl, and my Squeezebox.  It is one step
closer than viewing all the communication with Ethereal.

I think I got the basics working, but not sure if my approach was the
best.  I am passing the proxied IoSession into the constructor of the
IoConnector's IoHandler.  (Code snippets may make more sense than that
sentence.)  On messageReceive() from the proxy, should I be doing this
everytime:

readBuffer.acquire();
ConnectFuture future = _connector.connect(new InetSocketAddress(
sendToIP, 3483), new SlimClientProxy(session) );
future.join(); // Wait until the connection attempt is finished.
IoSession writeSession = future.getSession();
writeSession.write(message);

Thanks,
Cameron

On 4/10/06, Vinod Panicker <[EMAIL PROTECTED]> wrote:
> On 4/11/06, Cameron Taggart <[EMAIL PROTECTED]> wrote:
> > I am trying to implement a client/server TCP protocol with mina.  In
> > order to find out more about the TCP protocol, I have been trying to
> > create a proxy.  An example of how to create a proxy would be great.
>
> What kind of proxy are you trying to create?  In other words, what
> protocol will you be proxying?
>
> > I am a bit confused on yow to use IoConnector's.  There are lots of
> > examples on how to bind to a port with an IoAcceptor and it would be
> > nice if there were more IoConnector examples.
>
> An IoConnector is quite similar to an IoAcceptor in terms of usage.
> It also needs a handler that will contain the logic for handling the
> events.
>
> > After receiving a
> > message is received by the IoHandler for the IoAcceptor, what should I
> > do to forward the message?
>
> Where do you want to forward the message?
>
> >  Can a ConnectFuture be reused?
>
> A ConnectFuture contains the result of a connection operation.  Since
> the connection would be unique, the ConnectFuture object would also be
> unique.  Can you explain what you mean in terms of reusability?
>
> >  What references should my IoAcceptor contain?
>
> It depends on how you are implementing your business logic, actually.
>
> > A proxy example that logged all communication would be ideal.
>
> Every proxy implements a particular protocol. ie - HTTP, SOCKS 4,
> SOCKS 5, etc.  What exactly are you looking at?
>
> Regards,
> Vinod.
>

Reply via email to