You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Vinod Panicker <vi...@gmail.com> on 2006/08/30 05:58:33 UTC

exceptionCaught() functionality

Hi,

Currently if the application calls a write() on MINA, it will get
notified of any exceptions via the exceptionCaught() method.  The
problem is that the application does not have any information as to
what data could not be written on the session.  To figure that out, it
either has to wait on the WriteFuture or implement some state
mechanism within the IoSession.

Any better ways to handle this?  Would it make sense for
exceptionCaught() to supply the buffer that could not be written?

Regards,
Vinod.

Re: exceptionCaught() functionality

Posted by Vinod Panicker <vi...@gmail.com>.
On 8/31/06, Trustin Lee <tr...@gmail.com> wrote:
> Hi Vinod,
>
> On 8/30/06, Vinod Panicker <vi...@gmail.com> wrote:
> >
> > Hi,
> >
> > Currently if the application calls a write() on MINA, it will get
> > notified of any exceptions via the exceptionCaught() method.  The
> > problem is that the application does not have any information as to
> > what data could not be written on the session.  To figure that out, it
> > either has to wait on the WriteFuture or implement some state
> > mechanism within the IoSession.
>
>
> Hmm, you are right.  We need to provide additional information.
>
> Any better ways to handle this?  Would it make sense for
> > exceptionCaught() to supply the buffer that could not be written?
>
>
> What do you think about creating a new exception 'WriteException' which
> extends IOException?  If this sounds reasonable, please create a JIRA issue
> for us. :)

I think this should do the trick. We can have more exceptions in the
future if needed.

I'll open a JIRA issue.

Regards,
Vinod.

Re: exceptionCaught() functionality

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

On 8/30/06, Vinod Panicker <vi...@gmail.com> wrote:
>
> Hi,
>
> Currently if the application calls a write() on MINA, it will get
> notified of any exceptions via the exceptionCaught() method.  The
> problem is that the application does not have any information as to
> what data could not be written on the session.  To figure that out, it
> either has to wait on the WriteFuture or implement some state
> mechanism within the IoSession.


Hmm, you are right.  We need to provide additional information.

Any better ways to handle this?  Would it make sense for
> exceptionCaught() to supply the buffer that could not be written?


What do you think about creating a new exception 'WriteException' which
extends IOException?  If this sounds reasonable, please create a JIRA issue
for us. :)

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6