You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Norman Maurer <no...@apache.org> on 2007/07/12 09:37:19 UTC

suspend/resume sessionOpen

Hi all,

I wrote some prototype for streaming mp3 (tcp) to a BARIX device. All works
well so far :-) 

Now I want to get sure that only one stream is send to the device at once. So I
thought about "pause" the new connection if it comes from the same ip and resume
it after the "old" connection was closed. 
Is it possible todo something like this ?

Or should i better use IoSession.setTrafficMask(..) to suspend / resume write
to the device ?

Any help is welcome.

bye
Norman



Re: suspend/resume sessionOpen

Posted by Trustin Lee <tr...@gmail.com>.
Hi Norman,

Sorry for the late response...

On 7/12/07, Norman Maurer <no...@apache.org> wrote:
> Hi all,
>
> I wrote some prototype for streaming mp3 (tcp) to a BARIX device. All works
> well so far :-)
>
> Now I want to get sure that only one stream is send to the device at once. So I
> thought about "pause" the new connection if it comes from the same ip and resume
> it after the "old" connection was closed.
> Is it possible todo something like this ?

Yes, but I'd just disconnect the old connection because the connection
might be a dead one just dangling because of undetected disconnection.

Even if you are going to give priority to the old one, I'd disconnect
rather than pausing the new connection.

> Or should i better use IoSession.setTrafficMask(..) to suspend / resume write
> to the device ?

Yes, you can.  You will have to insert suspendRead() into
sessionCreated() for precise traffic control.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6