IdSystat.pas 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. {
  17. Rev 1.4 10/26/2004 10:49:20 PM JPMugaas
  18. Updated ref.
  19. Rev 1.3 1/21/2004 4:04:04 PM JPMugaas
  20. InitComponent
  21. Rev 1.2 2/24/2003 10:29:46 PM JPMugaas
  22. Rev 1.1 12/6/2002 05:30:38 PM JPMugaas
  23. Now decend from TIdTCPClientCustom instead of TIdTCPClient.
  24. Rev 1.0 11/13/2002 08:02:24 AM JPMugaas
  25. }
  26. unit IdSystat;
  27. {
  28. Indy Systat Client TIdSystat
  29. Copyright (C) 2002 Winshoes Working Group
  30. Original author J. Peter Mugaas
  31. 2002-August-13
  32. Based on RFC 866
  33. Note that this protocol is officially called Active User
  34. }
  35. interface
  36. {$i IdCompilerDefines.inc}
  37. uses
  38. Classes,
  39. IdAssignedNumbers,
  40. IdTCPConnection,
  41. IdTCPClient;
  42. type
  43. TIdSystat = class(TIdTCPClientCustom)
  44. protected
  45. public
  46. constructor Create(AOwner: TComponent); override;
  47. procedure GetStat(ADest : TStrings);
  48. published
  49. property Port default IdPORT_SYSTAT;
  50. end;
  51. {
  52. Note that no result parsing is done because RFC 866 does not specify a syntax for
  53. a user list.
  54. Quoted from RFC 866:
  55. There is no specific syntax for the user list. It is recommended
  56. that it be limited to the ASCII printing characters, space, carriage
  57. return, and line feed. Each user should be listed on a separate
  58. line.
  59. }
  60. implementation
  61. { TIdSystat }
  62. constructor TIdSystat.Create(AOwner: TComponent);
  63. begin
  64. inherited Create(AOwner);
  65. Port := IdPORT_SYSTAT;
  66. end;
  67. procedure TIdSystat.GetStat(ADest: TStrings);
  68. begin
  69. Connect;
  70. try
  71. ADest.Text := IOHandler.AllData;
  72. finally
  73. Disconnect;
  74. end;
  75. end;
  76. end.