Re: About the time limit of connection keeps valid from standby mode

2008-09-11 Thread Allen Jiang
hi,Anderson Guo, if we use heart-beat detection mechanism,is it suitable to send heart-beat when the session is idle as follows: public void sessionIdle(IoSession iosession, IdleStatus idlestatus){ heartBeat(); } if not,should we new a thread to use heart-beat detection mechanism ? Best

RE: About the time limit of connection keeps valid from standby mode

2008-09-11 Thread li
Hi, Anderson Guo, Thanks for your reply. As you guess, my connection is a long-term connection and I hope it can recover as soon as the computer resumes from a standby mode. In standby mode, I think all programs and connections would go to sleep and also the heart-beat detection mechanism.

Re: About the time limit of connection keeps valid from standby mode

2008-09-11 Thread Allen Jiang
I agree with Anderson . - Original Message - From: Wenrui Guo [EMAIL PROTECTED] To: users@mina.apache.org Sent: Thursday, September 11, 2008 3:19 PM Subject: RE: About the time limit of connection keeps valid from standby mode Hi, Li I wonder if you understanding my explanation. But

Re: About the time limit of connection keeps valid from standby mode

2008-09-11 Thread Emmanuel Lecharny
li wrote: Thanks for all replies. I think I have got the answer although a little regret. There is nothing to regret : when it's impossible, it's impossible ;) -- -- cordialement, regards, Emmanuel Lécharny www.iktek.com directory.apache.org

RE: About the time limit of connection keeps valid from standby mode

2008-09-11 Thread Wenrui Guo
Hi, Li You write a wrong connection recovery handling block. Refer the following code snippet if you want to make the application can work well in all cases: /** * connect to specified MC identified by incoming internet address * * @param addr *

Re: How to program implement for different port in server and different connection in client

2008-09-11 Thread Allen Jiang
Hi,anderson, Your solution is effective,it looks great. Really admire your work! Best Regards! - Original Message - From: Wenrui Guo [EMAIL PROTECTED] To: Allen Jiang [EMAIL PROTECTED]; users@mina.apache.org; Apache Mina高性能通信框架研究邮件列表 [EMAIL PROTECTED] Sent: Thursday, September 11,

RE: About the time limit of connection keeps valid from standby mode

2008-09-11 Thread Wenrui Guo
Hi, Li It doesn't matter, just use the similar code I represented as below. It could be applied to MINA 1.x and MINA 2.x. I saw the source code change between 1.7 and 2.0-M1. :P BR anderson -Original Message- From: li [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2008

RE: About the time limit of connection keeps valid from standby mode

2008-09-11 Thread li
Hi, anderson Thanks. I will try it. Regards, Li Subject: RE: About the time limit of connection keeps valid from standby mode Date: Thu, 11 Sep 2008 17:10:12 +0800 From: [EMAIL PROTECTED] To: users@mina.apache.org Hi, Li It doesn't matter, just use the similar code I represented as

Re: How to program implement for different port in server and different connection in client

2008-09-11 Thread Mark Webb
+1 :) 2008/9/11 Emmanuel Lecharny [EMAIL PROTECTED] Wenrui Guo wrote: Hi Wentrui, BTW, I do believe experts in the mailing list can give more proper and complete solution than what I will give later. There are no such separation between 'experts' and users ! The MINA's users sometime

Re: sharing sessionstata between encoder and decoder

2008-09-11 Thread Emmanuel Lecharny
Hi, jan de vries wrote: Hello, I have a class which stores session specific data with session.setAttribute(SessionState.STATE_KEY, ss); But this contains data like (CharsetEncoder) which usage should not be interleaved by doDecode and encode. H. Don't you use a CharsetEncoder for sent

Re: sharing sessionstata between encoder and decoder

2008-09-11 Thread Emmanuel Lecharny
One strategy would be to synchronize the 'session' instance itself. jan de vries wrote: Well, it was just an example to make my point clear. My SessionState contaans a lot more then that. For the decoder you are right, but the encoder CharsetEncoder can give problems since Session.write might

Re: sharing sessionstata between encoder and decoder

2008-09-11 Thread Emmanuel Lecharny
jan de vries wrote: Well, it was just an example to make my point clear. My SessionState contaans a lot more then that. For the decoder you are right, but the encoder CharsetEncoder can give problems since Session.write might be called simultaneously if i understand the documentation