Le 7/26/13 11:46 AM, Jose María Zaragoza a écrit :
> Hello:
>
>
> I'm using Mina Core 2.0.7
>
> I use BufferedWriteFilter to send data and every time I write data for
> sending it ,  I flush this filter manually by this code:
>
> this.session.write(data);
> ((BufferedWriteFilter) f).flush(this.session);
>
>
>
> Sometimes I've to send data from the messageReceived() callback method.
> I've observed that until  messageReceived() finishes , data is not sent
>
> Example:
>
> public void messageReceived(IoSession session, Object message) throws 
> Exception
> {
>
> session.write("test");
> ((BufferedWriteFilter) f).flush(session);
>
> .....
> .....  ( doing stuffs )
> ......
>
> ( **here**, "test" is sent )
> }
>
>
> How I can send data  immediatly in messageReceived()  ?


You can't. Or if you want to do so, then do your write, and move the
logic you execute after the call to write() into the messageSent() method.

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 

Reply via email to