module.messagingservice.pp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {
  2. This file is part of the Free Component Library
  3. Copyright (c) 2024 by Michael Van Canneyt [email protected]
  4. FCM Messaging demo - web client : RPC client
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. unit module.messagingservice;
  12. {$mode ObjFPC}
  13. interface
  14. uses
  15. Classes, SysUtils, fprpcclient, service.messagingserver;
  16. type
  17. { TRPCModule }
  18. TRPCModule = class(TDataModule)
  19. Client: TPas2jsRPCClient;
  20. procedure DataModuleCreate(Sender: TObject);
  21. private
  22. FService: TMessagingService;
  23. public
  24. Property Service : TMessagingService Read FService;
  25. end;
  26. var
  27. RPCModule: TRPCModule;
  28. implementation
  29. {$R *.lfm}
  30. { TRPCModule }
  31. procedure TRPCModule.DataModuleCreate(Sender: TObject);
  32. begin
  33. FService:=TMessagingService.Create(Self);
  34. FService.RPCClient:=Client;
  35. end;
  36. end.