Hi,

Hmm... I don't really get this...

You are referring to corrupted messages - could you explain? Do you mean
that your modem gets disconnected or that messages are corrupted (i.e. wrong
text, etc)?

Your example will run fine for a single thread execution, BUT its not
efficient at all. During each thread invocation, you will start and stop the
main Service class, which takes time. Start the Service object once and run
the readMessages() method in a thread.

2009/8/4 vash1282 <[email protected]>

>
> Hi Mr Thanasis,
> This might be a trivial question to you, but I'd appreciate some
> pointers regardless.
>
> Is it possible for SMS lib classes to run simultaneously along other
> tasks in java by assigning it to a thread? Everytime I use this code,
> the sms I sent to the gsm modem will become corrupted most of the
> time, and when it is not corrupted, the automated reply will not be
> sent out from the gsm modem.
> however, when I take out the threads .. it runs fine on its own, but I
> need it to be running simultatneously with another thread.
>
> this is how I assigned the class to a thread in my main function; runs
> fine except that 50% of the incoming SMSs will be corrupted.. if
> there's any other way to do it pls advise..
> Cheers!
>
> ======================================================
>
> Thread r = new Thread(){
> public void run()
> {
>  ReadMessages sms = new ReadMessages();
>       try
>        {
>           sms.doIt();
>        } catch (Exception ex)
>        {
>         System.out.println("SMS Server failed to start : " + ex);
>            System.exit(-1);
>        }
> }
> };
> r.start();
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SMSLib User Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/SMSLib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to