Well, its ok to keep whatever smsLib background threads running as long as they do not callback anything on incoming SMS. I don't know the number of threads behind the scene but probably is not a problem. I am just too paranoid and should relax more I quess :-)
Main reason to keep everything in a single thread (reading sms, sending sms) is an application logic. I do not need to create any artifical fifo queues for messages, I _must handle_ messages accordingly within the app logic thread. Doing my own read/send can keep calls in a strict order. If I set NULL to notfication its ok, I think you mean these three listeners? srv.setInboundNotification(null); srv.setOutboundNotification(null); srv.setCallNotification(null); Doing a loop described below I probably can disable KEEP_ALIVE command as well, its an overhead because am doing a constant read polling anyway. How do I disable isAlive() AT command. Do I put "Settings.SERIAL_KEEPALIVE_INTERVAL = Integer.MAX_VALUE" and be ok? Minimising smsLib background threads I can put "Settings.QUEUE_THREADS = 1" and should be safe? thx ps: I am using the following modem and seems to work fine, I have sent and read test sms messages (7-bit encoding). modem: Samba 55-SET GSM/GPRS modem identifiation: are manufacturer=SIEMENS, model=MC55 site: http://www.openxtra.co.uk/accessories/sms-modems/samba55/prodsamba55.html > > Pseudo-code what I want to do: > > while(running) { > > //for-loop incoming sms messages and do the magic > > service.readMessages(smsIn, ALL); > > for(....) { > > // do the magic > > } > > > // do app-logic > > > // send pending outgoing messages and do the magic > > List smsOut = readPendingOutgoingMessagesFromApp(); > > for(...) { > > service.sendMessages(msg); > > // do the magic after a message sent > > } > Can you please explain what is your purpose? > Why do you want to shutdown the extra threads? I mean, if you don't > set your notification callback methods (set them to null), the > background thread will never call you. Is this enough, or you want to > actually shutdown the threads? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
