Remote Call Framework 3.3
Globals.hpp
Go to the documentation of this file.
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2022, Delta V Software. All rights reserved.
6 // https://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF under GPL terms.
12 //
13 // Version: 3.3
14 // Contact: support <at> deltavsoft.com
15 //
16 //******************************************************************************
17 
19 
20 #ifndef INCLUDE_RCF_GLOBALS_HPP
21 #define INCLUDE_RCF_GLOBALS_HPP
22 
23 #include <string>
24 
25 #include <RCF/Enums.hpp>
26 #include <RCF/Export.hpp>
27 
28 namespace RCF {
29 
30  class ZlibDll;
31  class OpenSslDll;
32  class OpenSslCryptoDll;
33  class RcfSession;
34 
35  enum SslImplementation;
36 
38  class RCF_EXPORT Globals
39  {
40 
41  public:
42  Globals();
43  ~Globals();
44 
46  void setDefaultSslImplementation(SslImplementation sslImplementation);
47 
49  SslImplementation getDefaultSslImplementation();
50 
52  void setDefaultConnectTimeoutMs(unsigned int connectTimeoutMs);
53 
55  unsigned int getDefaultConnectTimeoutMs();
56 
58  void setDefaultRemoteCallTimeoutMs(unsigned int remoteCallTimeoutMs);
59 
61  unsigned int getDefaultRemoteCallTimeoutMs();
62 
64  void setZlibDllName(const std::string & dllName);
65 
67  std::string getZlibDllName() const;
68 
70  void setOpenSslDllName(const std::string & dllName);
71 
73  std::string getOpenSslDllName() const;
74 
76  void setOpenSslCryptoDllName(const std::string & dllName);
77 
79  std::string getOpenSslCryptoDllName() const;
80 
81  // Sets the simultaneous publish limit.
82  // The publishing service issues messages asynchronously across all subscriber connections, and this setting controls how many asynchronous writes it can perform concurrently.
83  void setSimultaneousPublishLimit(std::size_t simultaneousPublishLimit);
84 
85  // Gets the simultaneous publish limit.
86  std::size_t getSimultaneousPublishLimit() const;
87 
88  // Default download directory for FileStream objects (deprecated).
89  void setFileStreamDefaultDownloadDirectory(const std::string & downloadDirectory);
90  std::string getFileStreamDefaultDownloadDirectory();
91 
92 
93  ZlibDll & getZlibDll();
94  OpenSslDll & getOpenSslDll();
95  OpenSslCryptoDll & getOpenSslCryptoDll();
96 
97  private:
98 
99  void releaseZlibDll();
100  void releaseOpenSslDll();
101  void releaseOpenSslCryptoDll();
102 
103  ZlibDll * mpZlibDll;
104  OpenSslDll * mpOpenSslDll;
105  OpenSslCryptoDll * mpOpenSslCryptoDll;
106 
107  std::string mZlibDllName;
108  std::string mOpenSslDllName;
109  std::string mOpenSslCryptoDllName;
110 
111  std::size_t mSimultaneousPublishLimit;
112 
113  std::string mFileStreamDefaultDownloadDirectory;
114 
115 #if defined(RCF_WINDOWS) && RCF_FEATURE_OPENSSL==0
116  // Windows builds without OpenSSL.
117  SslImplementation mDefaultSslImplementation = Si_Schannel;
118 #else
119  // All other builds.
120  SslImplementation mDefaultSslImplementation = Si_OpenSsl;
121 #endif
122 
123  unsigned int mClientConnectTimeoutMs = 1000 * 2;
124  unsigned int mClientRemoteCallTimeoutMs = 1000 * 10;
125  };
126 
129 
131  RCF_EXPORT Globals & globals();
132 
134 
135 } // namespace RCF
136 
137 #endif // ! INCLUDE_RCF_GLOBALS_HPP
RCF_EXPORT Globals & globals()
Exposes RCF global settings.
OpenSSL.
Definition: Enums.hpp:90
SslImplementation
Describes which SSL implementation to use.
Definition: Enums.hpp:84
Contains global RCF settings.
Definition: Globals.hpp:38
Definition: AmiIoHandler.hpp:23
Schannel.
Definition: Enums.hpp:87