summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-08-21 19:53:51 +0000
committerMarc Laukien <marc@zeroc.com>2001-08-21 19:53:51 +0000
commitb350b65a5be2b2b320953edb2d0283bbac7909eb (patch)
treeaa86af74cb20090d4d18d9803a485739e0c24708 /cpp/src
parent--Ice... (diff)
downloadice-b350b65a5be2b2b320953edb2d0283bbac7909eb.tar.bz2
ice-b350b65a5be2b2b320953edb2d0283bbac7909eb.tar.xz
ice-b350b65a5be2b2b320953edb2d0283bbac7909eb.zip
Ice.PrintProcessId, run.py cleanup
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/.depend2
-rw-r--r--cpp/src/Ice/Instance.cpp11
-rw-r--r--cpp/src/Ice/Network.cpp6
-rw-r--r--cpp/src/IcePack/Server.cpp15
4 files changed, 17 insertions, 17 deletions
diff --git a/cpp/src/Ice/.depend b/cpp/src/Ice/.depend
index 096a6223d1b..26e71165f09 100644
--- a/cpp/src/Ice/.depend
+++ b/cpp/src/Ice/.depend
@@ -9,7 +9,7 @@ Logger.o: Logger.cpp ../../include/Ice/Logger.h ../../include/Ice/ProxyF.h ../..
LoggerI.o: LoggerI.cpp ../Ice/LoggerI.h ../../include/Ice/Logger.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Config.h ../../include/Ice/ObjectF.h ../../include/Ice/Handle.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Native.h ../../include/Ice/LocalObject.h ../../include/Ice/Shared.h
TraceLevels.o: TraceLevels.cpp ../Ice/TraceLevels.h ../Ice/TraceLevelsF.h ../../include/Ice/Handle.h ../../include/Ice/Config.h ../../include/Ice/PropertiesF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Native.h ../../include/Ice/LocalObject.h ../../include/Ice/Shared.h ../../include/Ice/Properties.h
TraceUtil.o: TraceUtil.cpp ../Ice/TraceUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Config.h ../../include/Ice/ObjectF.h ../../include/Ice/Handle.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Native.h ../../include/Ice/LocalObject.h ../../include/Ice/Shared.h ../Ice/TraceLevelsF.h ../Ice/Instance.h ../../include/Ice/InstanceF.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../../include/Ice/ProxyFactoryF.h ../Ice/ThreadPoolF.h ../../include/Ice/EmitterF.h ../Ice/ValueFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/PicklerF.h ../Ice/TraceLevels.h ../../include/Ice/Logger.h ../../include/Ice/Stream.h ../../include/Ice/Buffer.h
-Instance.o: Instance.cpp ../Ice/Instance.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/Ice/Config.h ../../include/Ice/CommunicatorF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Native.h ../../include/Ice/LocalObject.h ../../include/Ice/Shared.h ../../include/Ice/PropertiesF.h ../../include/Ice/LoggerF.h ../Ice/TraceLevelsF.h ../../include/Ice/ProxyFactoryF.h ../Ice/ThreadPoolF.h ../../include/Ice/EmitterF.h ../Ice/ValueFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/PicklerF.h ../Ice/TraceLevels.h ../Ice/ProxyFactory.h ../../include/Ice/ReferenceF.h ../Ice/ThreadPool.h ../Ice/EventHandlerF.h ../Ice/Emitter.h ../Ice/TransceiverF.h ../Ice/ConnectorF.h ../Ice/EndpointF.h ../Ice/EventHandler.h ../../include/Ice/Stream.h ../../include/Ice/Buffer.h ../Ice/ValueFactoryManager.h ../../include/Ice/ValueFactoryF.h ../Ice/ObjectAdapterFactory.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/LocalException.h ../Ice/LoggerI.h ../../include/Ice/Logger.h ../Ice/PicklerI.h ../../include/Ice/Pickler.h
+Instance.o: Instance.cpp ../Ice/Instance.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/Ice/Config.h ../../include/Ice/CommunicatorF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Native.h ../../include/Ice/LocalObject.h ../../include/Ice/Shared.h ../../include/Ice/PropertiesF.h ../../include/Ice/LoggerF.h ../Ice/TraceLevelsF.h ../../include/Ice/ProxyFactoryF.h ../Ice/ThreadPoolF.h ../../include/Ice/EmitterF.h ../Ice/ValueFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/PicklerF.h ../Ice/TraceLevels.h ../Ice/ProxyFactory.h ../../include/Ice/ReferenceF.h ../Ice/ThreadPool.h ../Ice/EventHandlerF.h ../Ice/Emitter.h ../Ice/TransceiverF.h ../Ice/ConnectorF.h ../Ice/EndpointF.h ../Ice/EventHandler.h ../../include/Ice/Stream.h ../../include/Ice/Buffer.h ../Ice/ValueFactoryManager.h ../../include/Ice/ValueFactoryF.h ../Ice/ObjectAdapterFactory.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../Ice/LoggerI.h ../../include/Ice/Logger.h ../Ice/PicklerI.h ../../include/Ice/Pickler.h
Communicator.o: Communicator.cpp ../../include/Ice/Communicator.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Config.h ../../include/Ice/ObjectF.h ../../include/Ice/Handle.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Native.h ../../include/Ice/LocalObject.h ../../include/Ice/Shared.h ../../include/Ice/LoggerF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/PicklerF.h ../../include/Ice/PropertiesF.h ../../include/Ice/ValueFactoryF.h ../../include/Ice/Stream.h ../../include/Ice/InstanceF.h ../../include/Ice/Buffer.h
CommunicatorI.o: CommunicatorI.cpp ../Ice/CommunicatorI.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/Ice/Config.h ../../include/Ice/Communicator.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Native.h ../../include/Ice/LocalObject.h ../../include/Ice/Shared.h ../../include/Ice/LoggerF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/PicklerF.h ../../include/Ice/PropertiesF.h ../../include/Ice/ValueFactoryF.h ../Ice/PropertiesI.h ../../include/Ice/Properties.h ../Ice/Instance.h ../../include/Ice/CommunicatorF.h ../Ice/TraceLevelsF.h ../../include/Ice/ProxyFactoryF.h ../Ice/ThreadPoolF.h ../../include/Ice/EmitterF.h ../Ice/ValueFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../Ice/ProxyFactory.h ../../include/Ice/ReferenceF.h ../Ice/ThreadPool.h ../Ice/EventHandlerF.h ../../include/Ice/ObjectAdapter.h ../Ice/ValueFactoryManager.h ../Ice/ObjectAdapterFactory.h ../../include/Ice/Logger.h ../../include/Ice/Initialize.h ../../include/Ice/LocalException.h
ObjectAdapter.o: ObjectAdapter.cpp ../../include/Ice/ObjectAdapter.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Config.h ../../include/Ice/ObjectF.h ../../include/Ice/Handle.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Native.h ../../include/Ice/LocalObject.h ../../include/Ice/Shared.h ../../include/Ice/CommunicatorF.h ../../include/Ice/Stream.h ../../include/Ice/InstanceF.h ../../include/Ice/Buffer.h
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 08002462d84..41ba778cadc 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -16,6 +16,7 @@
#include <Ice/ValueFactoryManager.h>
#include <Ice/ObjectAdapterFactory.h>
#include <Ice/LocalException.h>
+#include <Ice/Properties.h>
#include <Ice/LoggerI.h>
#include <Ice/PicklerI.h>
@@ -145,6 +146,16 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope
if (++_globalStateCounter == 1) // Only on first call
{
+ string value = properties->getProperty("Ice.PrintProcessId");
+ if (atoi(value.c_str()) >= 1)
+ {
+#ifdef WIN32
+ cout << _getpid() << endl;
+#else
+ cout << getpid() << endl;
+#endif
+ }
+
#ifdef WIN32
WORD version = MAKEWORD(1, 1);
WSADATA data;
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 1c74ec036ad..34d88b86045 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -478,7 +478,7 @@ IceInternal::getAddress(const char* host, int port, struct sockaddr_in& addr)
JTCSyncT<JTCMutex> sync(getHostByNameMutex);
struct hostent* entry;
- int retry = 5; // TODO: Should be configurable
+ int retry = 5;
do
{
@@ -512,7 +512,7 @@ IceInternal::getLocalAddress(int port, struct sockaddr_in& addr)
JTCSyncT<JTCMutex> sync(getHostByNameMutex);
struct hostent* entry;
- int retry = 5; // TODO: Should be configurable
+ int retry = 5;
do
{
@@ -542,7 +542,7 @@ IceInternal::getLocalHost(bool numeric)
JTCSyncT<JTCMutex> sync(getHostByNameMutex);
struct hostent* entry;
- int retry = 5; // TODO: Should be configurable
+ int retry = 5;
do
entry = gethostbyname(host);
diff --git a/cpp/src/IcePack/Server.cpp b/cpp/src/IcePack/Server.cpp
index 115e1628b1f..5387708f0bb 100644
--- a/cpp/src/IcePack/Server.cpp
+++ b/cpp/src/IcePack/Server.cpp
@@ -25,12 +25,11 @@ usage(const char* n)
"-h, --help Show this message.\n"
"-v, --version Display the Ice version.\n"
"--nowarn Don't print any security warnings.\n"
- "--pid Print the process id on standard output upon startup.\n"
;
}
int
-run(int argc, char* argv[], CommunicatorPtr communicator, bool pid, bool nowarn)
+run(int argc, char* argv[], CommunicatorPtr communicator, bool nowarn)
{
PropertiesPtr properties = communicator->getProperties();
@@ -61,11 +60,6 @@ run(int argc, char* argv[], CommunicatorPtr communicator, bool pid, bool nowarn)
forwardAdapter->setObjectLocator(forward);
forwardAdapter->activate();
- if (pid)
- {
- cout << getpid() << endl;
- }
-
communicator->waitForShutdown();
return EXIT_SUCCESS;
}
@@ -76,7 +70,6 @@ main(int argc, char* argv[])
PropertiesPtr properties = getDefaultProperties(argc, argv);
bool nowarn = false;
- bool pid = false;
for (int i = 1; i < argc; ++i)
{
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
@@ -93,10 +86,6 @@ main(int argc, char* argv[])
{
nowarn = true;
}
- else if(strcmp(argv[i], "--pid") == 0)
- {
- pid = true;
- }
else
{
cerr << argv[0] << ": unknown option `" << argv[i] << "'" << endl;
@@ -111,7 +100,7 @@ main(int argc, char* argv[])
try
{
communicator = initializeWithProperties(properties);
- status = run(argc, argv, communicator, pid, nowarn);
+ status = run(argc, argv, communicator, nowarn);
}
catch(const LocalException& ex)
{