IdDayTimeUDP.pas 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.1 1/21/2004 2:12:42 PM JPMugaas
  18. InitComponent
  19. Rev 1.0 11/14/2002 02:17:14 PM JPMugaas
  20. }
  21. unit IdDayTimeUDP;
  22. interface
  23. {$i IdCompilerDefines.inc}
  24. uses
  25. IdAssignedNumbers, IdUDPBase, IdUDPClient;
  26. type
  27. TIdDayTimeUDP = class(TIdUDPClient)
  28. protected
  29. Function GetDayTimeStr : String;
  30. procedure InitComponent; override;
  31. public
  32. Property DayTimeStr : String read GetDayTimeStr;
  33. published
  34. property Port default IdPORT_DAYTIME;
  35. end;
  36. implementation
  37. { TIdDayTimeUDP }
  38. procedure TIdDayTimeUDP.InitComponent;
  39. begin
  40. inherited InitComponent;
  41. Port := IdPORT_DAYTIME;
  42. end;
  43. function TIdDayTimeUDP.GetDayTimeStr: String;
  44. begin
  45. //The string can be anything - The RFC says the server should discard packets
  46. Send(' '); {Do not Localize}
  47. Result := ReceiveString;
  48. end;
  49. end.