mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benoit Hudzia" <benoit.hud...@gmail.com>
Subject RE: filters
Date Fri, 01 Sep 2006 14:27:14 GMT
Yes , that's what I use anyway in my filter. 
 
But I have another question related to filters: when inside a filter you
want to send back a message on the same session ( ex error message due to
malformed message etc..). Using session write in the filter    works
perfectly fine and the message is sent back . But when I do join() on
writefuture object  returned while doing session.write(myMessage) within the
filter  . The whole thing hang up , it looks like a deadlock and I didn't
have time yet to look within the code, but I would like to know if it's a
normal behaviour or a bug? 
 
Ex: 
 
 
<http://directory.apache.org/subprojects/mina/apidocs/org/apache/mina/common
/IoFilter.html#messageReceived%28org.apache.mina.common.IoFilter.NextFilter,
%20org.apache.mina.common.IoSession,%20java.lang.Object%29> messageReceived(
<http://directory.apache.org/subprojects/mina/apidocs/org/apache/mina/common
/IoFilter.NextFilter.html> IoFilter.NextFilter nextFilter,
<http://directory.apache.org/subprojects/mina/apidocs/org/apache/mina/common
/IoSession.html> IoSession session,
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html> Object
message)
{
WriteFuture wf= session.write(new myMessage());
wf.join();
}
 
 
Benoit Hudzia
Parallel Computing Research Group
School of Computer Science & Informatics
University College Dublin
Ireland
 
Tel: +353 1 716 2403
Fax: +353 1 269 7262
E-mail: benoit [dot] hudzia [at] ucd [dot] ie
Web: <http://benoit.hudzia.googlepages.com/>  Personnal Web Page,
<http://voidreflections.blogspot.com> Blog
 
-----Original Message-----
From: Newcomb, Michael-P57487 [mailto:Michael.Newcomb@gdc4s.com] 
Sent: 01 September 2006 15:05
To: mina-dev@directory.apache.org
Subject: filters
 
So, I can transform the message before I call
nextFilter.write(message)...
And, if my filters decides *not* to send the message at all, do I just
not call nextFilter.write(message)?
 
Thanks,
Michael

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message