You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Kumaran Arul <AK...@woolworths.com.au> on 2006/12/22 04:20:35 UTC
RE: IoHandler Filter
Hi
I have a requirement where using filters to gunzip the request and gzip
the response.
I have my gunzip(..) logic in the messageReceived(...) callback on my
compression fileter and where can I put mt my
gzip(...) logic? I want to zip my content in the buffer prior to sending
the response to the peer.
I cannot use writeRequest(....) or messageSent(...) callbacks because by
the time these methods are fired the response wouldHave already been
sent to the peer.
Cheers
Arul
***********************************************************
CAUTION: This email and files included in its transmission
are solely intended for the use of the addressee(s) and may
contain information that is confidential and privileged.
If you receive this email in error, please advise us
immediately and delete it without copying the contents
contained within. Woolworths Limited (including its group
of companies) do not accept liability for the views
expressed within or the consequences of any computer
viruses that may be transmitted with this email. The
contents are also subject to copyright. No part of it
should be reproduced, adapted or transmitted without the
written consent of the copyright owner.
***********************************************************
Re: IoHandler Filter
Posted by Niklas Therning <ni...@trillian.se>.
Kumaran Arul wrote:
> Hi
>
>
>
> I have a requirement where using filters to gunzip the request and gzip
> the response.
>
> I have my gunzip(..) logic in the messageReceived(...) callback on my
> compression fileter and where can I put mt my
>
> gzip(...) logic? I want to zip my content in the buffer prior to sending
> the response to the peer.
>
> I cannot use writeRequest(....) or messageSent(...) callbacks because by
> the time these methods are fired the response wouldHave already been
> sent to the peer.
>
>
You need to implement filterWrite(...) in your IoFilter.
--
Niklas Therning
www.spamdrain.net
Re: IoHandler Filter
Posted by Vinod Panicker <vi...@gmail.com>.
On 12/22/06, Kumaran Arul <AK...@woolworths.com.au> wrote:
> Hi
>
>
>
> I have a requirement where using filters to gunzip the request and gzip
> the response.
>
> I have my gunzip(..) logic in the messageReceived(...) callback on my
> compression fileter and where can I put mt my
>
> gzip(...) logic? I want to zip my content in the buffer prior to sending
> the response to the peer.
>
> I cannot use writeRequest(....) or messageSent(...) callbacks because by
> the time these methods are fired the response wouldHave already been
> sent to the peer.
Have you looked at the Stream Compression filter that is bundled with
the mina package? For using zlib on tcp streams, the compression
filter would be your best bet. Unless your protocol already takes
care of assembling packets correctly.
Regards,
Vinod.