CommandHandler.pas 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. { $HDR$}
  2. {**********************************************************************}
  3. { Unit archived using Team Coherence }
  4. { Team Coherence is Copyright 2002 by Quality Software Components }
  5. { }
  6. { For further information / comments, visit our WEB site at }
  7. { http://www.TeamCoherence.com }
  8. {**********************************************************************}
  9. {}
  10. { $Log: 11233: CommandHandler.pas
  11. {
  12. { Rev 1.4 2003.08.20 2:03:32 PM czhower
  13. { Removed dependency on protocol unit
  14. }
  15. {
  16. { Rev 1.3 2003.07.11 3:56:26 PM czhower
  17. { Fixed to match changes in Indy.
  18. }
  19. {
  20. Rev 1.2 6/5/2003 10:51:04 PM BGooijen
  21. Commandhandlers can't be created without a server any more
  22. }
  23. {
  24. Rev 1.1 4/4/2003 7:43:44 PM BGooijen
  25. compile again
  26. }
  27. {
  28. { Rev 1.0 11/12/2002 09:15:02 PM JPMugaas
  29. { Initial check in. Import from FTP VC.
  30. }
  31. unit CommandHandler;
  32. interface
  33. {
  34. 2001-Nov-24 Peter Mee
  35. - Created.
  36. }
  37. uses
  38. IndyBox;
  39. type
  40. TCommandHandlerProc = class(TIndyBox)
  41. public
  42. procedure Test; override;
  43. end;
  44. implementation
  45. uses
  46. IdCmdTCPServer, IdCommandHandlers,
  47. SysUtils;
  48. { TCommandHandlerProc }
  49. procedure TCommandHandlerProc.Test;
  50. var
  51. LServer:TIdCmdTCPServer;
  52. LCH : TIdCommandHandler;
  53. begin
  54. // The parse parameters default must be true
  55. Check(IdParseParamsDefault = true, 'CommandHandler''s IdParseParamsDefault is false');
  56. LServer := TIdCmdTCPServer.Create(Nil);
  57. LCH := TIdCommandHandler.Create(LServer.CommandHandlers);
  58. try
  59. finally
  60. FreeAndNil(LCH);
  61. FreeAndNil(LServer);
  62. end;
  63. end;
  64. initialization
  65. TIndyBox.RegisterBox(TCommandHandlerProc, 'CommandHandler', 'Misc');
  66. end.