PushBase.cpp 917 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "PushBase.h"
  2. #include "Poco/Thread.h"
  3. CPushBase::CPushBase(pHttpPushCallback pCallback, pHttpPushFailCallback pFailCallback, int nPushType):m_pHttpPushCallback(pCallback), m_pHttpPushFailCallback(pFailCallback), m_nPushType(nPushType), m_bStopRetry(false), m_pPhmsPushSession(NULL)
  4. {
  5. m_pPhmsPushSession = new CPhmsPushSession;//¿ÉÄÜÅ×Òì³£
  6. m_threadPush.start(*this);
  7. }
  8. CPushBase::~CPushBase(void)
  9. {
  10. }
  11. void CPushBase::run()
  12. {
  13. Poco::Thread::sleep(3000*2);
  14. ExecutePushSession();
  15. return;
  16. }
  17. void CPushBase::EndPush()
  18. {
  19. m_bStopRetry = true;
  20. m_pPhmsPushSession->abort();
  21. m_threadPush.join();
  22. delete m_pPhmsPushSession;
  23. m_pPhmsPushSession = NULL;
  24. }
  25. string CPushBase::GetSessionId()
  26. {
  27. return m_pPhmsPushSession->GetSessionId();
  28. }
  29. void CPushBase::SetSessionId(string stringSessionId)
  30. {
  31. return m_pPhmsPushSession->SetSessionId(stringSessionId);
  32. }
  33. int CPushBase::GetPushType()
  34. {
  35. return m_nPushType;
  36. }