ECSoapServerConnection.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 ECSOAPSERVERCONNECTION_H
  18. #define ECSOAPSERVERCONNECTION_H
  19. #include <kopano/zcdefs.h>
  20. #include <kopano/kcodes.h>
  21. #include "ECThreadManager.h"
  22. #include "soapH.h"
  23. #include <kopano/ECConfig.h>
  24. extern int kc_ssl_options(struct soap *, char *protos, const char *ciphers, const char *prefciphers);
  25. class ECSoapServerConnection _kc_final {
  26. public:
  27. ECSoapServerConnection(ECConfig *);
  28. ~ECSoapServerConnection();
  29. ECRESULT ListenTCP(const char* lpServerName, int nServerPort, bool bEnableGET);
  30. ECRESULT ListenSSL(const char* lpServerName, int nServerPort, bool bEnableGET, const char* lpszKeyFile, const char* lpszKeyPass,
  31. const char* lpszCAFile, const char* lpszCAPath);
  32. ECRESULT ListenPipe(const char* lpPipeName, bool bPriority = false);
  33. ECRESULT MainLoop();
  34. // These can be called asynchronously from MainLoop();
  35. ECRESULT NotifyDone(struct soap *soap);
  36. ECRESULT ShutDown();
  37. ECRESULT DoHUP();
  38. ECRESULT GetStats(unsigned int *lpulQueueLength, double *lpdblAge, unsigned int *lpulThreadCount, unsigned int *lpulIdleThreads);
  39. static SOAP_SOCKET CreatePipeSocketCallback(void *lpParam);
  40. private:
  41. // Main thread handler
  42. ECDispatcher *m_lpDispatcher;
  43. ECConfig* m_lpConfig;
  44. std::string m_strPipeName;
  45. };
  46. #endif // #ifndef ECSOAPSERVERCONNECTION_H