Remote Call Framework 3.1
Globals.hpp
Go to the documentation of this file.
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2019, Delta V Software. All rights reserved.
6 // http://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
12 // under GPL terms.
13 //
14 // Version: 3.1
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18 
20 
21 #ifndef INCLUDE_RCF_GLOBALS_HPP
22 #define INCLUDE_RCF_GLOBALS_HPP
23 
24 #include <string>
25 
26 #include <RCF/Enums.hpp>
27 #include <RCF/Export.hpp>
28 
29 namespace RCF {
30 
31  class ZlibDll;
32  class OpenSslDll;
33  class OpenSslCryptoDll;
34  class RcfSession;
35 
36  enum SslImplementation;
37 
39  class RCF_EXPORT Globals
40  {
41 
42  public:
43  Globals();
44  ~Globals();
45 
47  void setDefaultSslImplementation(SslImplementation sslImplementation);
48 
50  SslImplementation getDefaultSslImplementation();
51 
53  void setDefaultConnectTimeoutMs(unsigned int connectTimeoutMs);
54 
56  unsigned int getDefaultConnectTimeoutMs();
57 
59  void setDefaultRemoteCallTimeoutMs(unsigned int remoteCallTimeoutMs);
60 
62  unsigned int getDefaultRemoteCallTimeoutMs();
63 
65  void setZlibDllName(const std::string & dllName);
66 
68  std::string getZlibDllName() const;
69 
71  void setOpenSslDllName(const std::string & dllName);
72 
74  std::string getOpenSslDllName() const;
75 
77  void setOpenSslCryptoDllName(const std::string & dllName);
78 
80  std::string getOpenSslCryptoDllName() const;
81 
82  // Sets the simultaneous publish limit.
83  // The publishing service issues messages asynchronously across all subscriber connections, and this setting controls how many asynchronous writes it can perform concurrently.
84  void setSimultaneousPublishLimit(std::size_t simultaneousPublishLimit);
85 
86  // Gets the simultaneous publish limit.
87  std::size_t getSimultaneousPublishLimit() const;
88 
89  // Default download directory for FileStream objects (deprecated).
90  void setFileStreamDefaultDownloadDirectory(const std::string & downloadDirectory);
91  std::string getFileStreamDefaultDownloadDirectory();
92 
93 
94  ZlibDll & getZlibDll();
95  OpenSslDll & getOpenSslDll();
96  OpenSslCryptoDll & getOpenSslCryptoDll();
97 
98  private:
99 
100  void releaseZlibDll();
101  void releaseOpenSslDll();
102  void releaseOpenSslCryptoDll();
103 
104  ZlibDll * mpZlibDll;
105  OpenSslDll * mpOpenSslDll;
106  OpenSslCryptoDll * mpOpenSslCryptoDll;
107 
108  std::string mZlibDllName;
109  std::string mOpenSslDllName;
110  std::string mOpenSslCryptoDllName;
111 
112  std::size_t mSimultaneousPublishLimit;
113 
114  std::string mFileStreamDefaultDownloadDirectory;
115 
116 #if defined(RCF_WINDOWS) && RCF_FEATURE_OPENSSL==0
117  // Windows builds without OpenSSL.
118  SslImplementation mDefaultSslImplementation = Si_Schannel;
119 #else
120  // All other builds.
121  SslImplementation mDefaultSslImplementation = Si_OpenSsl;
122 #endif
123 
124  unsigned int mClientConnectTimeoutMs = 1000 * 2;
125  unsigned int mClientRemoteCallTimeoutMs = 1000 * 10;
126  };
127 
130 
132  RCF_EXPORT Globals & globals();
133 
135 
136 } // namespace RCF
137 
138 #endif // ! INCLUDE_RCF_GLOBALS_HPP
RCF_EXPORT Globals & globals()
Exposes RCF global settings.
OpenSSL.
Definition: Enums.hpp:91
SslImplementation
Describes which SSL implementation to use.
Definition: Enums.hpp:85
Contains global RCF settings.
Definition: Globals.hpp:39
Definition: AmiIoHandler.hpp:24
Schannel.
Definition: Enums.hpp:88