You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2010/03/09 06:19:50 UTC

svn commit: r920675 - in /incubator/thrift/trunk/lib/cpp/src/transport: TSocketPool.cpp TSocketPool.h

Author: dreiss
Date: Tue Mar  9 05:19:50 2010
New Revision: 920675

URL: http://svn.apache.org/viewvc?rev=920675&view=rev
Log:
cpp: TSocketPool: make it possible to add servers by struct

Modified:
    incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.cpp
    incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.h

Modified: incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.cpp
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.cpp?rev=920675&r1=920674&r2=920675&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.cpp (original)
+++ incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.cpp Tue Mar  9 05:19:50 2010
@@ -125,6 +125,12 @@ void TSocketPool::addServer(const string
   servers_.push_back(shared_ptr<TSocketPoolServer>(new TSocketPoolServer(host, port)));
 }
 
+void TSocketPool::addServer(shared_ptr<TSocketPoolServer> &server) {
+  if (server) {
+    servers_.push_back(server);
+  }
+}
+
 void TSocketPool::setServers(const vector< shared_ptr<TSocketPoolServer> >& servers) {
   servers_ = servers;
 }

Modified: incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.h?rev=920675&r1=920674&r2=920675&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/transport/TSocketPool.h Tue Mar  9 05:19:50 2010
@@ -113,6 +113,11 @@ class TSocketPool : public TSocket {
    void addServer(const std::string& host, int port);
 
    /**
+    * Add a server to the pool
+    */
+  void addServer(boost::shared_ptr<TSocketPoolServer> &server);
+
+   /**
     * Set list of servers in this pool
     */
   void setServers(const std::vector< boost::shared_ptr<TSocketPoolServer> >& servers);