Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000.
  5. //
  6. // File: S E A R C H . H
  7. //
  8. // Contents: SSDP Search Response
  9. //
  10. // Notes:
  11. //
  12. // Author: mbend 10 Nov 2000
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "timer.h"
  17. #include "ssdpnetwork.h"
  18. #include "ssdptypes.h"
  19. #include "upthread.h"
  20. #include "upsync.h"
  21. class CSsdpSearchResponse : public CThreadBase
  22. {
  23. public:
  24. static HRESULT HrCreate(SOCKET * pSockLocal,
  25. SOCKADDR_IN * pSockRemote,
  26. char * szResponse, long nMX);
  27. void TimerFired();
  28. BOOL TimerTryToLock()
  29. {
  30. return m_critSec.FTryEnter();
  31. }
  32. void TimerUnlock()
  33. {
  34. m_critSec.Leave();
  35. }
  36. private:
  37. CSsdpSearchResponse();
  38. ~CSsdpSearchResponse();
  39. CSsdpSearchResponse(const CSsdpSearchResponse &);
  40. CSsdpSearchResponse & operator=(const CSsdpSearchResponse &);
  41. HRESULT HrInitialize(
  42. SOCKET * pSockLocal,
  43. SOCKADDR_IN * pSockRemote,
  44. char * szResponse,
  45. long nMX);
  46. long CalculateDelay();
  47. DWORD DwRun();
  48. CTimer<CSsdpSearchResponse> m_timer;
  49. long m_nMX;
  50. CUCriticalSection m_critSec;
  51. SOCKET m_sockLocal;
  52. SOCKADDR_IN m_sockRemote;
  53. char * m_szResponse;
  54. };