You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by mat <fo...@gmail.com> on 2007/07/27 19:15:28 UTC
setWriteTimeout and SetIdleTime
What is the difference between SetWriteTimeout(10) and SetIdleTime(
IdleStatus.WRITER_IDLE, 10)?. SetWriteTimeout(10) = fail to write remote
peer in 10 secs and SetIdleTime(IdleStatus.WRITER_IDLE, 10) = nothing to be
sent in 10 secs? Am I right?
Re: setWriteTimeout and SetIdleTime
Posted by Michael Bauroth <mi...@falcom.de>.
Charme (german) == charm, congeniality ;)
Michael
> Unfortunately it's a virtual forum that is actually an archive of the
> mailing list. It just has a posting feature for non-subscribers. BTW
> what is charme? :)
>
> Trustin
Re: setWriteTimeout and SetIdleTime
Posted by Trustin Lee <tr...@gmail.com>.
On 7/30/07, Michael Bauroth <mi...@falcom.de> wrote:
> Hi,
>
> don't know if mat possibly means a forum with categories?
> Such a forum has also it's charme :)
Unfortunately it's a virtual forum that is actually an archive of the
mailing list. It just has a posting feature for non-subscribers. BTW
what is charme? :)
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: setWriteTimeout and SetIdleTime
Posted by Michael Bauroth <mi...@falcom.de>.
Hi,
don't know if mat possibly means a forum with categories?
Such a forum has also it's charme :)
Regards
Michael
Trustin Lee schrieb:
> On 7/28/07, Mark <el...@gmail.com> wrote:
>> This issue came up when I first joined the list. The answer then was that
>> anyone who uses MINA is going to be a developer just by the nature of the
>> API. Therefore I say keep things the way they are. This will not only give
>> the 'users' insight into the development work that is happening, but allows
>> the MINA developers to better interact with the users.
>>
>> thats my $.02
>
> Yep, I agree with you. The customers are also developers, so I don't
> particularly feel we need a user list. However, I wanted to know what
> people thinks about it again because the mailing list traffic is
> increasing on and on.
>
> Cheers,
> Trustin
Re: setWriteTimeout and SetIdleTime
Posted by Trustin Lee <tr...@gmail.com>.
On 7/28/07, Mark <el...@gmail.com> wrote:
> This issue came up when I first joined the list. The answer then was that
> anyone who uses MINA is going to be a developer just by the nature of the
> API. Therefore I say keep things the way they are. This will not only give
> the 'users' insight into the development work that is happening, but allows
> the MINA developers to better interact with the users.
>
> thats my $.02
Yep, I agree with you. The customers are also developers, so I don't
particularly feel we need a user list. However, I wanted to know what
people thinks about it again because the mailing list traffic is
increasing on and on.
Cheers,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: setWriteTimeout and SetIdleTime
Posted by Mark <el...@gmail.com>.
This issue came up when I first joined the list. The answer then was that
anyone who uses MINA is going to be a developer just by the nature of the
API. Therefore I say keep things the way they are. This will not only give
the 'users' insight into the development work that is happening, but allows
the MINA developers to better interact with the users.
thats my $.02
On 7/27/07, Trustin Lee <tr...@gmail.com> wrote:
>
> On 7/28/07, mat <fo...@gmail.com> wrote:
> > So sorry about the confusion. what i meant was "Can we manage our
> discussion
> > threads by categories which leads people easy to find some topics".
>
> You can search the mailing list archives:
> http://mina.apache.org/mailing-lists.html#MailingLists-Archive
>
> I know the search engines there aren't as good as Google, but you can
> search for previous topics at least.
>
> We can't create many mailing lists to categorize messages because it
> can cause defragmentation of community. However, It might be a good
> idea to create a dedicated mailing list for users to exchange
> questions and answers between users, of course only if there's a lot
> of demand. WDYT, everyone?
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
--
..Cheers
Mark
Re: setWriteTimeout and SetIdleTime
Posted by Trustin Lee <tr...@gmail.com>.
On 7/28/07, mat <fo...@gmail.com> wrote:
> So sorry about the confusion. what i meant was "Can we manage our discussion
> threads by categories which leads people easy to find some topics".
You can search the mailing list archives:
http://mina.apache.org/mailing-lists.html#MailingLists-Archive
I know the search engines there aren't as good as Google, but you can
search for previous topics at least.
We can't create many mailing lists to categorize messages because it
can cause defragmentation of community. However, It might be a good
idea to create a dedicated mailing list for users to exchange
questions and answers between users, of course only if there's a lot
of demand. WDYT, everyone?
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: setWriteTimeout and SetIdleTime
Posted by mat <fo...@gmail.com>.
On 7/28/07, Trustin Lee <tr...@gmail.com> wrote:
>
> On 7/28/07, mat <fo...@gmail.com> wrote:
> > 1) Trustin, I asked this because I read the ChatServer example which
> > IoFutureListener was not applied for.
>
> Yeah some examples are not perfect and we need some work there. Any
> patches are welcome!
>
> > 2) Once more, why SetWriteTimeout since IoFutureListener also works?
> (why
> > makes things more complicated?)
>
> If writeTimeout is not set, Your IoFutureListener will not be notified
> on write timeout. It will of course be notified on write failure, but
> it will never be notified if the client is too slow to receive the
> message within a certain amount of time. So writeTimeout is a
> required feature even if we have IoFutureListener. The default value
> of writeTimeout is 1 minute IIRC.
>
> > 3) In our discussion forum, do we have categories for threads such as
> > generic questions, JIRA, bugs, testing related? I found out after a
> while it
> > was too hard to navigate the threads.
>
> Well, I don't quite understand what 'generic bugs' are, but if you
> have any questions about JIRA, you could use Atlassian support forum,
> and other open source testing framework community for testing
> questions.
So sorry about the confusion. what i meant was "Can we manage our discussion
threads by categories which leads people easy to find some topics".
HTH,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
Re: setWriteTimeout and SetIdleTime
Posted by Trustin Lee <tr...@gmail.com>.
On 7/28/07, mat <fo...@gmail.com> wrote:
> 1) Trustin, I asked this because I read the ChatServer example which
> IoFutureListener was not applied for.
Yeah some examples are not perfect and we need some work there. Any
patches are welcome!
> 2) Once more, why SetWriteTimeout since IoFutureListener also works? (why
> makes things more complicated?)
If writeTimeout is not set, Your IoFutureListener will not be notified
on write timeout. It will of course be notified on write failure, but
it will never be notified if the client is too slow to receive the
message within a certain amount of time. So writeTimeout is a
required feature even if we have IoFutureListener. The default value
of writeTimeout is 1 minute IIRC.
> 3) In our discussion forum, do we have categories for threads such as
> generic questions, JIRA, bugs, testing related? I found out after a while it
> was too hard to navigate the threads.
Well, I don't quite understand what 'generic bugs' are, but if you
have any questions about JIRA, you could use Atlassian support forum,
and other open source testing framework community for testing
questions.
HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: setWriteTimeout and SetIdleTime
Posted by mat <fo...@gmail.com>.
1) Trustin, I asked this because I read the ChatServer example which
IoFutureListener was not applied for.
2) Once more, why SetWriteTimeout since IoFutureListener also works? (why
makes things more complicated?)
3) In our discussion forum, do we have categories for threads such as
generic questions, JIRA, bugs, testing related? I found out after a while it
was too hard to navigate the threads.
On 7/28/07, Trustin Lee <tr...@gmail.com> wrote:
>
> On 7/28/07, mat <fo...@gmail.com> wrote:
> > So future.isWritten() is a better way to detect whether WRITE is
> > successfully than set session.SetWriteTimeOut()? future.join() seems
> > blocking the method(Wait for the asynchronous operation to end.) will
> that
> > affect the performance?
>
> Yes for the both questions. I recommed you to use IoFutureListener as
> always.
>
> HTH,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
Re: setWriteTimeout and SetIdleTime
Posted by Trustin Lee <tr...@gmail.com>.
On 7/28/07, mat <fo...@gmail.com> wrote:
> So future.isWritten() is a better way to detect whether WRITE is
> successfully than set session.SetWriteTimeOut()? future.join() seems
> blocking the method(Wait for the asynchronous operation to end.) will that
> affect the performance?
Yes for the both questions. I recommed you to use IoFutureListener as always.
HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: setWriteTimeout and SetIdleTime
Posted by mat <fo...@gmail.com>.
So future.isWritten() is a better way to detect whether WRITE is
successfully than set session.SetWriteTimeOut()? future.join() seems
blocking the method(Wait for the asynchronous operation to end.) will that
affect the performance?
On 7/28/07, Trustin Lee <tr...@gmail.com> wrote:
> On 7/28/07, mat <fo...@gmail.com> wrote:
> > If Write_Idle doesn't throws an exception, what does it do?
>
> Well, sessionIdle is invoked instead. For some cases, it's not an
> exceptional but an expected case, so user might not want
> WriteTimeoutException.
>
> And.. you are right. You don't need to set both writeTimeout and
> WRITER_IDLE. You can choose either.
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
Re: setWriteTimeout and SetIdleTime
Posted by Trustin Lee <tr...@gmail.com>.
On 7/28/07, mat <fo...@gmail.com> wrote:
> If Write_Idle doesn't throws an exception, what does it do?
Well, sessionIdle is invoked instead. For some cases, it's not an
exceptional but an expected case, so user might not want
WriteTimeoutException.
And.. you are right. You don't need to set both writeTimeout and
WRITER_IDLE. You can choose either.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: setWriteTimeout and SetIdleTime
Posted by mat <fo...@gmail.com>.
If Write_Idle doesn't throws an exception, what does it do?
On 7/28/07, Trustin Lee <tr...@gmail.com> wrote:
>
> On 7/28/07, Mike Heath <mh...@apache.org> wrote:
> > setWriteTimeout sets the TCP option for write timeout. So in your
> > example, if you don't receive a SYN packet from the remote host within
> > 10 seconds from sending a packet, the OS will timeout the TCP
> > connection.
>
> To tell the truth, it's MINA which detects the write timeout.
> IoSession.writeTimeout property doesn't have any relationship with
> TCP-level packet timeout. MINA throws WriteTimeoutException if a
> certain buffer is not fully written within the configured amount of
> time (writeTimeout).
>
> writeTimeout and WRITER_IDLE are very similar to each other, but they
> are different in that writeTimeout throws an exception while
> WRITER_IDLE doesn't. They are usually used for different purposes.
>
> HTH,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
Re: setWriteTimeout and SetIdleTime
Posted by Mike Heath <mh...@apache.org>.
On 7/27/07, Trustin Lee <tr...@gmail.com> wrote:
> On 7/28/07, Mike Heath <mh...@apache.org> wrote:
> > setWriteTimeout sets the TCP option for write timeout. So in your
> > example, if you don't receive a SYN packet from the remote host within
> > 10 seconds from sending a packet, the OS will timeout the TCP
> > connection.
>
> To tell the truth, it's MINA which detects the write timeout.
> IoSession.writeTimeout property doesn't have any relationship with
> TCP-level packet timeout. MINA throws WriteTimeoutException if a
> certain buffer is not fully written within the configured amount of
> time (writeTimeout).
Thanks Trustin for clearing up my misinformation. I read the question
too quickly before sending a reply. :)
Re: setWriteTimeout and SetIdleTime
Posted by Trustin Lee <tr...@gmail.com>.
On 7/28/07, Mike Heath <mh...@apache.org> wrote:
> setWriteTimeout sets the TCP option for write timeout. So in your
> example, if you don't receive a SYN packet from the remote host within
> 10 seconds from sending a packet, the OS will timeout the TCP
> connection.
To tell the truth, it's MINA which detects the write timeout.
IoSession.writeTimeout property doesn't have any relationship with
TCP-level packet timeout. MINA throws WriteTimeoutException if a
certain buffer is not fully written within the configured amount of
time (writeTimeout).
writeTimeout and WRITER_IDLE are very similar to each other, but they
are different in that writeTimeout throws an exception while
WRITER_IDLE doesn't. They are usually used for different purposes.
HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: setWriteTimeout and SetIdleTime
Posted by Mike Heath <mh...@apache.org>.
setWriteTimeout sets the TCP option for write timeout. So in your
example, if you don't receive a SYN packet from the remote host within
10 seconds from sending a packet, the OS will timeout the TCP
connection.
setIdleTime tells MINA to initiate an idle event when the session is
idle after the specified amount of time for the specified operation
(read, write, or both).
Does that help?
-Mike
On 7/27/07, mat <fo...@gmail.com> wrote:
> What is the difference between SetWriteTimeout(10) and SetIdleTime(
> IdleStatus.WRITER_IDLE, 10)?. SetWriteTimeout(10) = fail to write remote
> peer in 10 secs and SetIdleTime(IdleStatus.WRITER_IDLE, 10) = nothing to be
> sent in 10 secs? Am I right?
>