On 4/11/06, Cameron Taggart <[EMAIL PROTECTED]> wrote:
> 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.

cool!

> 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.

So basically what you want to do is tunnel everything?

> 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);

Unfortunately I don't have the time right now to look at the protocol,
but do you need to do a connect() everytime you receive something? 
Usually once a connection is established, all you should need to do is
just send() once you receive a message.

Regards,
Vinod.

Reply via email to