Hi Trustin, > Yes, it's correct. Once the messageSent event is fired, it is forwarded > to > IoHandler even if the connection is being closed at the moment. It is > because all events are stored in a queue. > I think the messageSent event is not related to what I meant. I mentioned about the *decode* and *messageReceived* methods.
I want to withdraw my assumption because based on my test-results, it was not correct. I have added an counter (static variable) and this variable will be increased 1 when the *decode()* is invoked and it will be decreased 1 when the *messageReceived()* is invoked. My expected result is when the system is stopped successful, this counter's value must be zero (0). But it was not. Could we treat this problem is a bug of MINA framework? Did you remember there was a time I asked about this kind of questions? And I already had my own solution: the main thread will wait until the counter is zero before stopped successfully. But I think that mina has to finish all message by itself. How do you think? Thanks & best regards, Hieu Phan. > -----Original Message----- > From: Trustin Lee [mailto:[EMAIL PROTECTED] > Sent: Monday, November 06, 2006 9:42 PM > To: [email protected] > Subject: Re: [MINA] Does MINA finish all "decoded messages" before > stopping? > > On 11/6/06, Hieu Phan Thanh <[EMAIL PROTECTED]> wrote: > > > > Hello, > > I have a confused: > > My software is listening on some data ports. > > When user wants to stop the software, I used the > > "SocketAcceptor.unbindAll()" as usual. > > I think that all messages which have been decoded are finished by mina > > framework at messageReceived() method. > > I have been testing this problem and it seems my assumption is correct. > > > Yes, it's correct. Once the messageSent event is fired, it is forwarded > to > IoHandler even if the connection is being closed at the moment. It is > because all events are stored in a queue. > > 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
