Author Topic: Re: TnsGSM - Thread safe???  (Read 814 times)


  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: TnsGSM - Thread safe???
« on: January 13, 2014, 10:59:16 am »
Hi there
Im using the TnrGSM to communicate with my Cinterion GSM Modem and all is working well :-)
This device will sit on the server.
Im now writing another exe to sit on many Client PCs, which will allow staff to send SMS from these client PCs.  Im using Indy 10 TidTCPServer etc for the Client/Server communication.
My question is.....  Is TnrGSM thread safe, ie can it be used in the TidTCPserver???  If not, would it be best to serialise the client SMS's, by passing the client SMS's to a queue in the main server thread (ie on the main server form)??? and just loop through the queue (ie say a TStringList) and pass each StringList.Item
  • to the TnrSMS individually.

Do you have any thoughts, or basic examples??

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1008
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: TnsGSM - Thread safe???
« Reply #1 on: January 16, 2014, 06:14:54 am »

Sorry if my reply is too late. SMTP server of our hoster works not perfect.

TnrGsm works with real GSM device. 
If you will change various properties and call methods from different threads at random, of course, component will not work correct.
But by default we assume that TnrGsm is thread safe :-)

You can create an ancestor of TnrGsm with needed functionality for make SMS queue and control calls from different threads.

Please note that you can use TnrPduSms class for serialization SMS into/from PDU format.

Roman Novgorodov
DeepSoftware llc

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