Skip to content

Commit

Permalink
add hasRemote to ClientBasic
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Sep 30, 2011
1 parent 8e75d32 commit f8a70a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions db/client.h
Expand Up @@ -105,6 +105,7 @@ namespace mongo {
bool isGod() const { return _god; } /* this is for map/reduce writes */
string toString() const;
void gotHandshake( const BSONObj& o );
bool hasRemote() const { return _mp; }
HostAndPort getRemote() const { assert( _mp ); return _mp->remote(); }
BSONObj getRemoteID() const { return _remoteId; }
BSONObj getHandshake() const { return _handshake; }
Expand Down
2 changes: 2 additions & 0 deletions db/client_common.h
Expand Up @@ -35,6 +35,8 @@ namespace mongo {
virtual ~ClientBasic(){}
virtual const AuthenticationInfo * getAuthenticationInfo() const = 0;
virtual AuthenticationInfo * getAuthenticationInfo() = 0;

virtual bool hasRemote() const = 0;
virtual HostAndPort getRemote() const = 0;

static ClientBasic* getCurrent();
Expand Down
2 changes: 2 additions & 0 deletions s/client.h
Expand Up @@ -41,6 +41,8 @@ namespace mongo {
/** client disconnected */
void disconnect();

bool hasRemote() const { return true; }

/**
* @return remote socket address of the client
*/
Expand Down

0 comments on commit f8a70a8

Please sign in to comment.