Author Topic: Does TnrGsm support Multi-Thread program developement  (Read 1356 times)

weggin

  • Newbie
  • *
  • Posts: 8
    • View Profile
Does TnrGsm support Multi-Thread program developement
« on: July 17, 2010, 04:39:57 am »
Hi roman:
   I want to use a pc to control 4 GSM device to work individually,like sent and receive sms by the different GSM devices in one pc at the same time.
Could i use Multi-Thread program to initial the TnrGsm component?
so i can receive different events(like OnAfterInit,OnSmsReceived, OnSmsSent...etc) from different GSM devices.

Thanks!

weggin

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Does TnrGsm support Multi-Thread program developement
« Reply #1 on: July 28, 2010, 10:15:55 am »
Hello

You need 4 instances of TnrGsm object for work with 4 gsm devices.

Of course we implemented asynchronous way for control gsm device.
Every pair of TnrComm and TnrGsm will work in separated thread.

Please note that TnrComm has UseMainThread property.
It controls which thread will be used for call event handler.

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.

henry64

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Does TnrGsm support Multi-Thread program developement
« Reply #2 on: August 14, 2010, 05:40:30 pm »
So, does UseMainThread have to be false when runtime created in a thread?

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Does TnrGsm support Multi-Thread program developement
« Reply #3 on: August 14, 2010, 06:33:49 pm »
Hello

If UseMainThread is True, all events and data handling (gsm device replies, notifications etc.) will be executed in main form thread.
It can be necessary for correct working visual controls.

If you do not worry about controls you can use False for more correct multi-thread working.

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.