PacketDropPlugin.cpp 732 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #include "PacketDropPlugin.h"
  11. PacketDropPlugin::PacketDropPlugin(void)
  12. {
  13. timer.SetTimerLength(500);
  14. }
  15. PacketDropPlugin::~PacketDropPlugin(void)
  16. {
  17. }
  18. PluginReceiveResult PacketDropPlugin::OnReceive(Packet *packet)
  19. {
  20. if (timer.IsExpired())
  21. {
  22. return RR_CONTINUE_PROCESSING;
  23. }
  24. else
  25. {
  26. return RR_STOP_PROCESSING;
  27. }
  28. }
  29. void PacketDropPlugin::StartTest()
  30. {
  31. timer.Start();
  32. }
粤ICP备19079148号