Commit 6ab0916d authored by legoc's avatar legoc
Browse files

Added getServer to Request.

parent 5c997ca5
......@@ -962,8 +962,10 @@ void Request::reply(const std::string& response) {
std::auto_ptr<Instance> Request::connectToRequester() {
// Instantiate the requester server.
m_requesterServer.reset(new Server(m_impl->m_requesterServerEndpoint));
// Instantiate the requester server if it does not exist.
if (m_requesterServer.get() == 0) {
m_requesterServer.reset(new Server(m_impl->m_requesterServerEndpoint));
}
// Connect and find the instance.
InstanceArray instances = m_requesterServer->connectAll(m_impl->m_requesterApplicationName);
......@@ -978,6 +980,10 @@ std::auto_ptr<Instance> Request::connectToRequester() {
return auto_ptr<Instance>(0);
}
std::auto_ptr<Server> Request::getServer() {
return m_requesterServer;
}
///////////////////////////////////////////////////////////////////////////
// Responder
......
......@@ -368,6 +368,11 @@ public:
std::auto_ptr<Instance> connectToRequester();
/**
* Transfers the ownership of the requester server.
*/
std::auto_ptr<Server> getServer();
private:
Request(std::auto_ptr<RequestImpl> & impl);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment