Modem cluster

Q: I have GSM modem cluster and I need save all incomming messages to database. How can I manage it?

A: It's easy, just create TGSM instance for each modem.

TMyModule = class(TDataModule)
  fMyModems: array[1..MaxModems] of TGSM;
  procedure OnReceiveSMS(Sender.......)
  constructor Create()...

//and create it in

constructor TMyModule.Create; var I: integer; begin for I:= Low(fMyModems) to High(fMyModems) do begin fMyModems[i]:= TGSM.Create(Self); fMyModems[i].ComDevice:= TComm.Create(fMyModems[I]); fMyModems[i].OnReceiveSMS := OnReceiveSMS; fMyModems[i].OnRxChar:= .... end; end;

procedure TMyModule.OnReceiveSMS(Sender: TObject, ....); begin TGSM(Sender) is class instance that holds reference to a fMyModem end;

Thanks for your support. But

Thanks for your support. But how to add support for load balancing between the modems. I'm trying to development a SMS server using 3 modems with load balancing support (priority as follow: destination of SMS is same operator with modem, next is most idle,...).

You know modem configuration

You know modem configuration (GSM operator or so) then you can use any modem for SendSMS(), i.e. fMyModems[i].SendSMS(). There is also TGSM.IsBusy and TGSM.OnBusyChanged that may tell that modem is receiving (busy).