diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2005-03-03 19:30:02 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2005-03-03 19:30:02 +0000 |
commit | 1bcd262719e5fd1008e30ab9f4987e1ceac9bc21 (patch) | |
tree | 803e4a341916a037f037bf2ef864ef0bd22a1648 /cpp | |
parent | *** empty log message *** (diff) | |
download | ice-1bcd262719e5fd1008e30ab9f4987e1ceac9bc21.tar.bz2 ice-1bcd262719e5fd1008e30ab9f4987e1ceac9bc21.tar.xz ice-1bcd262719e5fd1008e30ab9f4987e1ceac9bc21.zip |
Use config files
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/demo/Ice/MFC/client/HelloClient.cpp | 5 | ||||
-rw-r--r-- | cpp/demo/Ice/MFC/client/HelloClientDlg.cpp | 5 | ||||
-rw-r--r-- | cpp/demo/Ice/MFC/client/config | 47 | ||||
-rw-r--r-- | cpp/demo/Ice/MFC/server/HelloServer.cpp | 9 | ||||
-rw-r--r-- | cpp/demo/Ice/MFC/server/config | 46 |
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 |