summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Ice/MFC/client/HelloClient.cpp5
-rw-r--r--cpp/demo/Ice/MFC/client/HelloClientDlg.cpp5
-rw-r--r--cpp/demo/Ice/MFC/client/config47
-rw-r--r--cpp/demo/Ice/MFC/server/HelloServer.cpp9
-rw-r--r--cpp/demo/Ice/MFC/server/config46
5 files changed, 99 insertions, 13 deletions
diff --git a/cpp/demo/Ice/MFC/client/HelloClient.cpp b/cpp/demo/Ice/MFC/client/HelloClient.cpp
index e50424e35e7..0ed631775c3 100644
--- a/cpp/demo/Ice/MFC/client/HelloClient.cpp
+++ b/cpp/demo/Ice/MFC/client/HelloClient.cpp
@@ -47,10 +47,7 @@ CHelloClientApp::InitInstance()
{
int argc = 0;
Ice::PropertiesPtr properties = Ice::createProperties();
- properties->setProperty("Ice.Plugin.IceSSL", "IceSSL:create");
- properties->setProperty("IceSSL.Client.CertPath", "../../../../certs");
- properties->setProperty("IceSSL.Client.Config", "sslconfig.xml");
-
+ properties->load("config");
communicator = Ice::initializeWithProperties(argc, 0, properties);
}
catch(const IceUtil::Exception& ex)
diff --git a/cpp/demo/Ice/MFC/client/HelloClientDlg.cpp b/cpp/demo/Ice/MFC/client/HelloClientDlg.cpp
index c1f7fba58aa..5cea643eb5b 100644
--- a/cpp/demo/Ice/MFC/client/HelloClientDlg.cpp
+++ b/cpp/demo/Ice/MFC/client/HelloClientDlg.cpp
@@ -64,7 +64,10 @@ CHelloClientDlg::OnInitDialog()
//
// Create the proxy.
//
- Ice::ObjectPrx obj = _communicator->stringToProxy("hello:tcp -p 10000:udp -p 10000:ssl -p 10001");
+ Ice::PropertiesPtr properties = _communicator->getProperties();
+ const char* proxyProperty = "Hello.Proxy";
+ std::string proxy = properties->getProperty(proxyProperty);
+ Ice::ObjectPrx obj = _communicator->stringToProxy(proxy);
_proxy = Demo::HelloPrx::uncheckedCast(obj);
_currentProxy = _proxy;
_status->SetWindowText(CString(" Ready"));
diff --git a/cpp/demo/Ice/MFC/client/config b/cpp/demo/Ice/MFC/client/config
new file mode 100644
index 00000000000..44db27f89eb
--- /dev/null
+++ b/cpp/demo/Ice/MFC/client/config
@@ -0,0 +1,47 @@
+#
+# The client reads this property to create the reference to the
+# "hello" object in the server.
+#
+Hello.Proxy=hello:tcp -p 10000:udp -p 10000:ssl -p 10001
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
+
+#
+# Network Tracing
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
+Ice.Trace.Network=0
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
+Ice.Trace.Protocol=0
+
+#
+# Security Tracing
+#
+# 0 = no security tracing
+# 1 = trace warning messages
+# 2 = config file parsing warnings
+#
+IceSSL.Trace.Security=0
+
+#
+# SSL Configuration File
+#
+# An XML based file that specifies the certificates, keys, SSL version
+# and other pertinent information for creating an SSL connection.
+#
+Ice.Plugin.IceSSL=IceSSL:create
+IceSSL.Client.CertPath=../../../../certs
+IceSSL.Client.Config=sslconfig.xml
diff --git a/cpp/demo/Ice/MFC/server/HelloServer.cpp b/cpp/demo/Ice/MFC/server/HelloServer.cpp
index 4da2c101770..f0e467c9e05 100644
--- a/cpp/demo/Ice/MFC/server/HelloServer.cpp
+++ b/cpp/demo/Ice/MFC/server/HelloServer.cpp
@@ -51,14 +51,7 @@ BOOL CHelloServerApp::InitInstance()
{
int argc = 0;
Ice::PropertiesPtr properties = Ice::createProperties();
- properties->setProperty("Hello.Endpoints", "tcp -p 10000:udp -p 10000:ssl -p 10001");
- properties->setProperty("Ice.Trace.Network", "1");
- properties->setProperty("Ice.Warn.Connections", "1");
-
- properties->setProperty("Ice.Plugin.IceSSL", "IceSSL:create");
- properties->setProperty("IceSSL.Server.CertPath", "../../../../certs");
- properties->setProperty("IceSSL.Server.Config", "sslconfig.xml");
-
+ properties->load("config");
communicator = Ice::initializeWithProperties(argc, 0, properties);
log = new LogI;
communicator->setLogger(log);
diff --git a/cpp/demo/Ice/MFC/server/config b/cpp/demo/Ice/MFC/server/config
new file mode 100644
index 00000000000..e88bb4d86f0
--- /dev/null
+++ b/cpp/demo/Ice/MFC/server/config
@@ -0,0 +1,46 @@
+#
+# The server creates one single object adapter with the name
+# "Hello". The following line sets the endpoints for this
+# adapter.
+#
+Hello.Endpoints=tcp -p 10000:udp -p 10000:ssl -p 10001
+
+#
+# Warn about connection exceptions
+#
+Ice.Warn.Connections=1
+
+#
+# 0 = no network tracing
+# 1 = trace connection establishment and closure
+# 2 = like 1, but more detailed
+# 3 = like 2, but also trace data transfer
+#
+Ice.Trace.Network=1
+
+#
+# Protocol Tracing
+#
+# 0 = no protocol tracing
+# 1 = trace protocol messages
+#
+Ice.Trace.Protocol=0
+
+#
+# Security Tracing
+#
+# 0 = no security tracing
+# 1 = trace warning messages
+# 2 = config file parsing warnings
+#
+IceSSL.Trace.Security=0
+
+#
+# SSL Configuration File
+#
+# An XML based file that specifies the certificates, keys, SSL version
+# and other pertinent information for creating an SSL connection.
+#
+Ice.Plugin.IceSSL=IceSSL:create
+IceSSL.Server.CertPath=../../../../certs
+IceSSL.Server.Config=sslconfig.xml