IdDiscardServer.pas 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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: 10131: IdDiscardServer.pas
  11. {
  12. { Rev 1.0 2002.11.12 10:36:02 PM czhower
  13. }
  14. unit IdDiscardServer;
  15. interface
  16. {
  17. 2000-Apr-22: J Peter Mugass
  18. Ported to Indy
  19. 1999-Apr-13
  20. Final Version
  21. 2000-JAN-13 MTL
  22. Moved to new Palette Scheme (Winshoes Servers)
  23. Original Author: Ozz Nixon
  24. }
  25. uses
  26. Classes,
  27. IdAssignedNumbers,
  28. IdTCPServer;
  29. Type
  30. TIdDISCARDServer = class ( TIdTCPServer )
  31. protected
  32. function DoExecute(AThread: TIdPeerThread ): Boolean; override;
  33. public
  34. constructor Create(AOwner: TComponent); override;
  35. published
  36. property DefaultPort default IdPORT_DISCARD;
  37. end;
  38. implementation
  39. uses
  40. IdGlobal,
  41. SysUtils;
  42. constructor TIdDISCARDServer.Create(AOwner: TComponent);
  43. begin
  44. inherited;
  45. DefaultPort := IdPORT_DISCARD;
  46. end;
  47. function TIdDISCARDServer.DoExecute(AThread: TIdPeerThread): Boolean;
  48. begin
  49. Result := True;
  50. // Discard it
  51. AThread.Connection.InputBuffer.Remove(AThread.Connection.InputBuffer.Size);
  52. end;
  53. end.