IdUnixTimeUDP.pas 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.0 2/10/2005 2:26:38 PM JPMugaas
  18. New UnixTime Service (port 519) components.
  19. }
  20. unit IdUnixTimeUDP;
  21. interface
  22. {$i IdCompilerDefines.inc}
  23. uses
  24. Classes,
  25. IdAssignedNumbers, IdTimeUDP;
  26. {
  27. This is based on a description at
  28. http://amo.net/AtomicTimeZone/help/ATZS_Protocols.htm#Unix
  29. UnixTime and UnixTime Protocol
  30. Unix is an operating system developed in 1969 by Ken Thompson. UnixTime counts
  31. "epochs" or seconds since the Year 1970. UnixTime recently hit it's billionth
  32. birthday.
  33. Because Unix is widely used in many environments, UnixTime was developed into
  34. a loose simple time protocol in the late 80's and early 90's. No formal
  35. UnixTime protocol has ever been officially published as an internet protocol -
  36. until now.
  37. UnixTime operates on the same UnixTime port - 519. Once a connection is
  38. requested on this port, exactly like in Time Protocol, the UnixTime value
  39. is sent back by either tcp/ip or udp/ip. When UDP/IP is used, a small packet
  40. of data must be received by the server in order to respond in the exact same
  41. fashion as Time Protocol. The UnixTime is then sent as an unsigned
  42. "unformatted" integer on the same port.
  43. }
  44. type
  45. TIdUnixTimeUDP = class(TIdCustomTimeUDP)
  46. public
  47. constructor Create(AOwner: TComponent); override;
  48. published
  49. property Port default IdPORT_utime;
  50. end;
  51. implementation
  52. uses IdGlobalProtocols;
  53. { TIdTUniximeUDP }
  54. constructor TIdUnixTimeUDP.Create(AOwner: TComponent);
  55. begin
  56. inherited Create(AOwner);
  57. Port := IdPORT_utime;
  58. FBaseDate := UNIXSTARTDATE;
  59. end;
  60. end.