Received: by 10.66.85.37 with SMTP id e5mr3401048paz.31.1348642467329; Tue, 25 Sep 2012 23:54:27 -0700 (PDT) X-BeenThere: mongodb-user@googlegroups.com Received: by 10.68.226.100 with SMTP id rr4ls3818149pbc.2.gmail; Tue, 25 Sep 2012 23:54:16 -0700 (PDT) Received: by 10.68.194.133 with SMTP id hw5mr9161pbc.17.1348642456550; Tue, 25 Sep 2012 23:54:16 -0700 (PDT) Date: Tue, 25 Sep 2012 23:54:16 -0700 (PDT) From: David Hows To: mongodb-user@googlegroups.com Message-Id: In-Reply-To: References: <0f9c80f5-e0dc-417d-85c4-caaab3352666@googlegroups.com> Subject: Re: How to connect to multiple mongod instances with c++ driver MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_725_6034615.1348642456235" ------=_Part_725_6034615.1348642456235 Content-Type: multipart/alternative; boundary="----=_Part_726_22295029.1348642456235" ------=_Part_726_22295029.1348642456235 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Thomas, To confirm, your issue is that you wish to be able to use the same DbAuthHook class to implement auth on two different connections too two different servers/databases. Your problem is that you are unable too determine which database is which from within DbAuthHook? My question is how do you intend to pass the auth variables into that class? If you are loading them statically (they are hard coded inside your application) within DbAuthHook by comparing the give server (by IP + Port) could you not just use conn.getServerAddress() or conn.toString() to get the connection string and then compare to from within DbAuthHook? Cheers, David ------=_Part_726_22295029.1348642456235 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Thomas,

To confirm, your issue is that you wish to be able to use the same DbAuthHook class to implement auth on two different connections too two different servers/databases.

Your problem is that you are unable too determine which database is which from within DbAuthHook?

My question is how do you intend to pass the auth variables into that class? 

If you are loading them statically (they are hard coded inside your application) within DbAuthHook by comparing the give server (by IP + Port) could you not just use conn.getServerAddress() or conn.toString() to get the connection string and then compare to from within DbAuthHook?

Cheers,

David
------=_Part_726_22295029.1348642456235-- ------=_Part_725_6034615.1348642456235--