• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
March 29, 2024, 01:38:03 am

News:

SMF - Just Installed!


Re: TnsGSM - Thread safe???

Started by leeparvin, January 13, 2014, 08:59:16 am

Previous topic - Next topic

leeparvin

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??

    Thanks

    Lee

Roman Novgorodov

Hello

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.