SMS blocking port until they are not discarded one by one
I have a j2me app in which I receive a number of SMS in a process, but when sometime it has some error or exception it stops there by showing error but what happens is that the remaining SMS which actually has been sent by the Server, do not receive on port rather they stay over the port. I yet didn't close the port but due to exception occurrence my app doesn't receive those SMS, I also tried to close and open the port again at that moment but still same issue. And when I close app(exit) and restart it, I receive those remaining SMS before my new process get it's own SMS. So I have to wait for those OLD sms to discard and then move processing my new one. I need some solution that when I get exception somehow my remaining SMS on port should be discarded. Note: I am closing my port only on exit, and opening and runtime of app. Thanks
Re: SMS blocking port until they are not discarded one by one
You have to make sure that the app is not going to crashed unexpectedly, do proper exception handling and if you don't want to receive the SMS's if the exception/error comes then inside the catch handler just de-registered the port.
Re: SMS blocking port until they are not discarded one by one
[QUOTE=raj_J2ME;910851]You have to make sure that the app is not going to crashed unexpectedly, do proper exception handling and if you don't want to receive the SMS's if the exception/error comes then inside the catch handler just de-registered the port.[/QUOTE]
For the time being I am not closing this port on exception, but when I close application there I am closing this port. And when this all happens and I restart the application same issue comes, if you are saying that closing the port can solve this problem then it should have already done this. Is there anything am not doing right?
Re: SMS blocking port until they are not discarded one by one
[QUOTE=saqibatiq;911008]For the time being I am not closing this port on exception, but when I close application there I am closing this port. And when this all happens and I restart the application same issue comes, if you are saying that closing the port can solve this problem then it should have already done this. Is there anything am not doing right?[/QUOTE]
I am talking about the closing of the port when the exception came and app is getting crashed.