• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

Routines inside SmsListIntem Event

Started by jboavida, January 20, 2009, 10:34:51 pm

Previous topic - Next topic

jboavida

January 20, 2009, 10:34:51 pm Last Edit: January 20, 2009, 10:37:49 pm by jboavida
Hi,

Can I put something inside SmsListItem event or not ?

When I read the contents to a MemoBox (like the example you provided) the reading of say 25 messages takes about 5 seconds.
If I have something that takes more than a few miliseconds to execute if takes about 4 minutes to read the messages and takes the CPU up to 100%.

Example I have inside SmsList the following:


SaveMessage(aSms.Phone,aSms.Datetime,aSms.Text);


This procedure simply creates a new record on a dataset and fetches the data.
Does not take that long...

Is SmsListItem Event time critical? I call smslist with the wait argument false.

It is best to save the data to a memory record and fetch to database later ?

Thanks in advance

Joaquim


Roman Novgorodov

Hello Joaquim

Yes, you are right, the getting SMS list is time critical process.
Current release of TnrGsm sends get list command to device and raises OnSmsListItem event on every list item.
Therefore if your OnSmsListItem handler takes long runtime, you can get timeouts or missing messages.

I recommend you to use OnSmsListItem event for place every messages in your own memory buffer (or list).
After that when SmsList is finished, you can save content of your memory cash into database.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.