You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by FredAtMina <fr...@gmail.com> on 2007/11/09 17:12:17 UTC

Is it possible to "reset" the READER_IDLE "timer"

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
-- 
View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13669984
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by Mark <el...@gmail.com>.
I would suggest submitting a JIRA entry.

On Nov 13, 2007 11:56 AM, FredAtMina <fr...@gmail.com> wrote:
>
> That's what I did. I'm testing this. But I was looking at something directly
> available in the API. It seems it is not available.
> This may be a good feature for this API, to have a idle timer between the
> last write and the read.
>
>
>
>
>
> elihusmails wrote:
> >
> > Could you couple the idle notification with a flag in the session or
> > the getLast(Read|Write)Time.
> >
> >
> >
> > On Nov 13, 2007 10:31 AM, FredAtMina <fr...@gmail.com> wrote:
> >>
> >> I want a timer between the write and the read. The timer starts at the
> >> write,
> >> and fires a idle notify when there is no read before the end of the
> >> delay.
> >>
> >>
> >>
> >> elihusmails wrote:
> >> >
> >> > So you want a separate timer for both reading and writing?
> >> >
> >> >
> >> > On Nov 13, 2007 7:46 AM, FredAtMina <fr...@gmail.com> wrote:
> >> >>
> >> >>
> >> >> I want to reset the reader_idle "timer" so the "countdown" begins when
> >> I
> >> >> sent data, not when I read the previous data.
> >> >> For ex:
> >> >> Request (write) [writer_idle timer begins] .... Response (read)
> >> >> [reader_idle
> >> >> timer begins]
> >> >> I would like a timer between the write and the response.
> >> >>
> >> >> Thanks!
> >> >>
> >> >> Fred
> >> >>
> >> >>
> >> >>
> >> >> Trustin Lee wrote:
> >> >> >
> >> >> > I actually didn't understand what problem you are trying to fix.
> >> More
> >> >> > hints are appreciated.
> >> >> >
> >> >> > Trustin
> >> >> >
> >> >> > On Nov 13, 2007 3:26 AM, FredAtMina <fr...@gmail.com> wrote:
> >> >> >>
> >> >> >>
> >> >> >> No idea anyone ?
> >> >> >>
> >> >> >> Regards,
> >> >> >>
> >> >> >> Fred
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> 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
> >> >> >> >
> >> >> >>
> >> >> >> --
> >> >> >> View this message in context:
> >> >> >>
> >> >>
> >> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13711231
> >> >> >>
> >> >> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> >> >> Nabble.com.
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > what we call human nature is actually human habit
> >> >> > --
> >> >> > http://gleamynode.net/
> >> >> > --
> >> >> > PGP Key ID: 0x0255ECA6
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13725070
> >> >>
> >> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> >> Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > --------------------------------
> >> > 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
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13728180
> >>
> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> Nabble.com.
> >>
> >>
> >
> >
> >
> > --
> > --------------------------------
> > 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
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13730085
>
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>



-- 
--------------------------------
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

Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by FredAtMina <fr...@gmail.com>.
That's what I did. I'm testing this. But I was looking at something directly
available in the API. It seems it is not available.
This may be a good feature for this API, to have a idle timer between the
last write and the read.




elihusmails wrote:
> 
> Could you couple the idle notification with a flag in the session or
> the getLast(Read|Write)Time.
> 
> 
> 
> On Nov 13, 2007 10:31 AM, FredAtMina <fr...@gmail.com> wrote:
>>
>> I want a timer between the write and the read. The timer starts at the
>> write,
>> and fires a idle notify when there is no read before the end of the
>> delay.
>>
>>
>>
>> elihusmails wrote:
>> >
>> > So you want a separate timer for both reading and writing?
>> >
>> >
>> > On Nov 13, 2007 7:46 AM, FredAtMina <fr...@gmail.com> wrote:
>> >>
>> >>
>> >> I want to reset the reader_idle "timer" so the "countdown" begins when
>> I
>> >> sent data, not when I read the previous data.
>> >> For ex:
>> >> Request (write) [writer_idle timer begins] .... Response (read)
>> >> [reader_idle
>> >> timer begins]
>> >> I would like a timer between the write and the response.
>> >>
>> >> Thanks!
>> >>
>> >> Fred
>> >>
>> >>
>> >>
>> >> Trustin Lee wrote:
>> >> >
>> >> > I actually didn't understand what problem you are trying to fix. 
>> More
>> >> > hints are appreciated.
>> >> >
>> >> > Trustin
>> >> >
>> >> > On Nov 13, 2007 3:26 AM, FredAtMina <fr...@gmail.com> wrote:
>> >> >>
>> >> >>
>> >> >> No idea anyone ?
>> >> >>
>> >> >> Regards,
>> >> >>
>> >> >> Fred
>> >> >>
>> >> >>
>> >> >>
>> >> >> 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
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13711231
>> >> >>
>> >> >> Sent from the Apache MINA Support Forum mailing list archive at
>> >> >> Nabble.com.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > what we call human nature is actually human habit
>> >> > --
>> >> > http://gleamynode.net/
>> >> > --
>> >> > PGP Key ID: 0x0255ECA6
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13725070
>> >>
>> >> Sent from the Apache MINA Support Forum mailing list archive at
>> >> Nabble.com.
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > --------------------------------
>> > 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
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13728180
>>
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com.
>>
>>
> 
> 
> 
> -- 
> --------------------------------
> 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
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13730085
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by Mark <el...@gmail.com>.
Could you couple the idle notification with a flag in the session or
the getLast(Read|Write)Time.



On Nov 13, 2007 10:31 AM, FredAtMina <fr...@gmail.com> wrote:
>
> I want a timer between the write and the read. The timer starts at the write,
> and fires a idle notify when there is no read before the end of the delay.
>
>
>
> elihusmails wrote:
> >
> > So you want a separate timer for both reading and writing?
> >
> >
> > On Nov 13, 2007 7:46 AM, FredAtMina <fr...@gmail.com> wrote:
> >>
> >>
> >> I want to reset the reader_idle "timer" so the "countdown" begins when I
> >> sent data, not when I read the previous data.
> >> For ex:
> >> Request (write) [writer_idle timer begins] .... Response (read)
> >> [reader_idle
> >> timer begins]
> >> I would like a timer between the write and the response.
> >>
> >> Thanks!
> >>
> >> Fred
> >>
> >>
> >>
> >> Trustin Lee wrote:
> >> >
> >> > I actually didn't understand what problem you are trying to fix.  More
> >> > hints are appreciated.
> >> >
> >> > Trustin
> >> >
> >> > On Nov 13, 2007 3:26 AM, FredAtMina <fr...@gmail.com> wrote:
> >> >>
> >> >>
> >> >> No idea anyone ?
> >> >>
> >> >> Regards,
> >> >>
> >> >> Fred
> >> >>
> >> >>
> >> >>
> >> >> 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
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13711231
> >> >>
> >> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> >> Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > what we call human nature is actually human habit
> >> > --
> >> > http://gleamynode.net/
> >> > --
> >> > PGP Key ID: 0x0255ECA6
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13725070
> >>
> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> Nabble.com.
> >>
> >>
> >
> >
> >
> > --
> > --------------------------------
> > 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
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13728180
>
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>



-- 
--------------------------------
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

Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by FredAtMina <fr...@gmail.com>.
I want a timer between the write and the read. The timer starts at the write,
and fires a idle notify when there is no read before the end of the delay.


elihusmails wrote:
> 
> So you want a separate timer for both reading and writing?
> 
> 
> On Nov 13, 2007 7:46 AM, FredAtMina <fr...@gmail.com> wrote:
>>
>>
>> I want to reset the reader_idle "timer" so the "countdown" begins when I
>> sent data, not when I read the previous data.
>> For ex:
>> Request (write) [writer_idle timer begins] .... Response (read)
>> [reader_idle
>> timer begins]
>> I would like a timer between the write and the response.
>>
>> Thanks!
>>
>> Fred
>>
>>
>>
>> Trustin Lee wrote:
>> >
>> > I actually didn't understand what problem you are trying to fix.  More
>> > hints are appreciated.
>> >
>> > Trustin
>> >
>> > On Nov 13, 2007 3:26 AM, FredAtMina <fr...@gmail.com> wrote:
>> >>
>> >>
>> >> No idea anyone ?
>> >>
>> >> Regards,
>> >>
>> >> Fred
>> >>
>> >>
>> >>
>> >> 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
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13711231
>> >>
>> >> Sent from the Apache MINA Support Forum mailing list archive at
>> >> Nabble.com.
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > what we call human nature is actually human habit
>> > --
>> > http://gleamynode.net/
>> > --
>> > PGP Key ID: 0x0255ECA6
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13725070
>>
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com.
>>
>>
> 
> 
> 
> -- 
> --------------------------------
> 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
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13728180
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by Mark <el...@gmail.com>.
So you want a separate timer for both reading and writing?


On Nov 13, 2007 7:46 AM, FredAtMina <fr...@gmail.com> wrote:
>
>
> I want to reset the reader_idle "timer" so the "countdown" begins when I
> sent data, not when I read the previous data.
> For ex:
> Request (write) [writer_idle timer begins] .... Response (read) [reader_idle
> timer begins]
> I would like a timer between the write and the response.
>
> Thanks!
>
> Fred
>
>
>
> Trustin Lee wrote:
> >
> > I actually didn't understand what problem you are trying to fix.  More
> > hints are appreciated.
> >
> > Trustin
> >
> > On Nov 13, 2007 3:26 AM, FredAtMina <fr...@gmail.com> wrote:
> >>
> >>
> >> No idea anyone ?
> >>
> >> Regards,
> >>
> >> Fred
> >>
> >>
> >>
> >> 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
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13711231
> >>
> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> Nabble.com.
> >>
> >>
> >
> >
> >
> > --
> > what we call human nature is actually human habit
> > --
> > http://gleamynode.net/
> > --
> > PGP Key ID: 0x0255ECA6
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13725070
>
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>



-- 
--------------------------------
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

Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by FredAtMina <fr...@gmail.com>.

I want to reset the reader_idle "timer" so the "countdown" begins when I
sent data, not when I read the previous data. 
For ex:
Request (write) [writer_idle timer begins] .... Response (read) [reader_idle
timer begins]
I would like a timer between the write and the response.

Thanks!

Fred


Trustin Lee wrote:
> 
> I actually didn't understand what problem you are trying to fix.  More
> hints are appreciated.
> 
> Trustin
> 
> On Nov 13, 2007 3:26 AM, FredAtMina <fr...@gmail.com> wrote:
>>
>>
>> No idea anyone ?
>>
>> Regards,
>>
>> Fred
>>
>>
>>
>> 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
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13711231
>>
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com.
>>
>>
> 
> 
> 
> -- 
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13725070
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by Trustin Lee <tr...@gmail.com>.
I actually didn't understand what problem you are trying to fix.  More
hints are appreciated.

Trustin

On Nov 13, 2007 3:26 AM, FredAtMina <fr...@gmail.com> wrote:
>
>
> No idea anyone ?
>
> Regards,
>
> Fred
>
>
>
> 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
> >
>
> --
> View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13711231
>
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>



-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by FredAtMina <fr...@gmail.com>.

No idea anyone ?

Regards,

Fred


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
> 

-- 
View this message in context: http://www.nabble.com/Is-it-possible-to-%22reset%22-the-READER_IDLE-%22timer%22-tf4778577s16868.html#a13711231
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by Mark <el...@gmail.com>.
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 <mh...@apache.org> 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

Re: Is it possible to "reset" the READER_IDLE "timer"

Posted by Mike Heath <mh...@apache.org>.
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