PushBase.h 729 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "PhmsDataType.h"
  3. #include "Poco/Thread.h"
  4. #include "Poco/Runnable.h"
  5. #include "PhmsPushSession.h"
  6. using Poco::Thread;
  7. using Poco::Runnable;
  8. #define MSG_LIST_PUSH (0)
  9. class CPushBase:public Runnable
  10. {
  11. public:
  12. CPushBase(pHttpPushCallback pCallback, pHttpPushFailCallback pFailCallback, int nPushType);
  13. virtual ~CPushBase(void);
  14. void run();
  15. void EndPush();
  16. string GetSessionId();
  17. void SetSessionId(string stringSessionId);
  18. int GetPushType();
  19. protected:
  20. virtual void ExecutePushSession()=0;
  21. protected:
  22. pHttpPushCallback m_pHttpPushCallback;
  23. pHttpPushFailCallback m_pHttpPushFailCallback;
  24. CPhmsPushSession* m_pPhmsPushSession;
  25. bool m_bStopRetry;
  26. private:
  27. Thread m_threadPush;
  28. int m_nPushType;
  29. };