summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpidd.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-10-17 09:41:26 +0000
committerGordon Sim <gsim@apache.org>2008-10-17 09:41:26 +0000
commit3e298ab616597ab3eb6f8859b72651a8b67505b0 (patch)
tree67ba47a1c8862700ce11b44dce9fbd3864fea8f1 /qpid/cpp/src/qpidd.cpp
parentb67f0fcee107e921a160ab208256c500b8230261 (diff)
downloadqpid-python-3e298ab616597ab3eb6f8859b72651a8b67505b0.tar.gz
QPID-106: SSL support for c++ (broker and client), can be enabled/disabled explictly via --with-ssl/--without-ssl args to configure; by default will build the modules if dependencies are found. See SSL readme file for more details.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@705534 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpidd.cpp')
-rw-r--r--qpid/cpp/src/qpidd.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpidd.cpp b/qpid/cpp/src/qpidd.cpp
index 1d272dbd5c..2cc7a0b6e6 100644
--- a/qpid/cpp/src/qpidd.cpp
+++ b/qpid/cpp/src/qpidd.cpp
@@ -63,6 +63,7 @@ struct DaemonOptions : public qpid::Options {
bool check;
int wait;
std::string piddir;
+ std::string transport;
DaemonOptions() : qpid::Options("Daemon options"), daemon(false), quit(false), check(false), wait(10)
{
@@ -76,6 +77,7 @@ struct DaemonOptions : public qpid::Options {
addOptions()
("daemon,d", optValue(daemon), "Run as a daemon. --log-output defaults to syslog in this mode.")
+ ("transport", optValue(transport, "TRANSPORT"), "The transport for which to return the port")
("pid-dir", optValue(piddir, "DIR"), "Directory where port-specific PID file is stored")
("wait,w", optValue(wait, "SECONDS"), "Sets the maximum wait time to initialize the daemon. If the daemon fails to initialize, prints an error and returns 1")
("check,c", optValue(check), "Prints the daemon's process ID to stdout and returns 0 if the daemon is running, otherwise returns 1")
@@ -130,7 +132,7 @@ struct QpiddDaemon : public Daemon {
/** Code for parent process */
void parent() {
uint16_t port = wait(options->daemon.wait);
- if (options->broker.port == 0)
+ if (options->broker.port == 0 || !options->daemon.transport.empty())
cout << port << endl;
}
@@ -138,7 +140,7 @@ struct QpiddDaemon : public Daemon {
void child() {
boost::intrusive_ptr<Broker> brokerPtr(new Broker(options->broker));
broker::SignalHandler::setBroker(brokerPtr);
- uint16_t port=brokerPtr->getPort();
+ uint16_t port=brokerPtr->getPort(options->daemon.transport);
ready(port); // Notify parent.
brokerPtr->run();
}
@@ -238,8 +240,8 @@ int main(int argc, char* argv[])
else { // Non-daemon broker.
boost::intrusive_ptr<Broker> brokerPtr(new Broker(options->broker));
broker::SignalHandler::setBroker(brokerPtr);
- if (options->broker.port == 0)
- cout << uint16_t(brokerPtr->getPort()) << endl;
+ if (options->broker.port == 0 || !options->daemon.transport.empty())
+ cout << uint16_t(brokerPtr->getPort(options->daemon.transport)) << endl;
brokerPtr->run();
}
return 0;