Good point.

I think that what Fred is talking about may be a nice feature to have in MINA.

Thanks Mike.

On Nov 13, 2007 12:58 PM, Mike Heath <[EMAIL PROTECTED]> wrote:
> You could just use java.util.Timer and handle this yourself.  When you
> send data, you could schedule a TimerTask with the timer.  If you
> receive a response, cancle the TimerTask.  If you don't receive a
> response, the TimerTask will execute and you can perform your timeout
> code there.
>
> -Mike
>
>
> FredAtMina wrote:
> > Hi all,
> >
> > I'm using mina in order to send / receive 1 byte at a time. I would like to
> > use the IDLE timer so I can have this behavior:
> > reset the READER_IDLE timer just after sending data, so the
> > ioHandler.sessionIdle is called whenever the server takes longer then the
> > READER_IDLE to reply to the client.
> > So, for example, if the TIMOUT is set to 1 second, I want
> > ioHandler.sessionIdle to be called when there is more than 1 second of delay
> > between the send and the receive, not between the last two receive...
> >
> > As I don't see any "reset" in the IoSession API, I'm thinking about:
> > - using BOTH_IDLE, but I'm not sure it is doing what I want (i.e. is the
> > time reset whenever there is a write or a read) ?
> > (having BOTH_IDLE and READ_IDLE should meet my requirement if this works as
> > I hope)
> > - using the getLastReadTime and getLastWriteTime to approximate this
> > behavior,
> > but before that, I want to be sure there is no way to reset the timer.
> >
> > Regards,
> >
> > Fred
>
>



-- 
--------------------------------
The adjuration to be "normal" seems shockingly repellent to me; I see
neither hope nor comfort in sinking to that low level. I think it is
ignorance that makes people think of abnormality only with horror and
allows them to remain undismayed at the proximity of "normal" to
average and mediocre. For surely anyone who achieves anything is,
essentially, abnormal.
     Dr. Karl Menninger

Reply via email to