ECChannelClient.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #ifndef ECCHANNELCLIENT_H
  18. #define ECCHANNELCLIENT_H
  19. #include <string>
  20. #include <vector>
  21. #include <kopano/zcdefs.h>
  22. #include <kopano/platform.h>
  23. #include <kopano/kcodes.h>
  24. namespace KC {
  25. class ECChannel;
  26. class _kc_export ECChannelClient {
  27. public:
  28. ECChannelClient(const char *szPath, const char *szTokenizer);
  29. ~ECChannelClient();
  30. ECRESULT DoCmd(const std::string &strCommand, std::vector<std::string> &lstResponse);
  31. protected:
  32. ECRESULT Connect();
  33. _kc_hidden ECRESULT ConnectSocket(void);
  34. _kc_hidden ECRESULT ConnectHttp(void);
  35. unsigned int m_ulTimeout = 5; ///< Response timeout in second
  36. private:
  37. std::string m_strTokenizer;
  38. std::string m_strPath;
  39. bool m_bSocket;
  40. uint16_t m_ulPort;
  41. ECChannel *m_lpChannel = nullptr;
  42. };
  43. } /* namespace */
  44. #endif /* ECCHANNELCLIENT_H */