summaryrefslogtreecommitdiff
path: root/util/sock.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2010-04-02 13:01:32 -0400
committerMathias Stearn <mathias@10gen.com>2010-04-02 13:21:27 -0400
commit1d10bf7d5e9dde57f03ddc163c23216bb6daf757 (patch)
tree64b9432739f2c41012337a37ae4ae4e2c91f7d51 /util/sock.h
parentb03cc0e07df2f5b012401cd2dc56b35eff0a68d0 (diff)
downloadmongo-1d10bf7d5e9dde57f03ddc163c23216bb6daf757.tar.gz
Combine SockAddr::localhost() and isLocalHost()
Diffstat (limited to 'util/sock.h')
-rw-r--r--util/sock.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/util/sock.h b/util/sock.h
index ae8b4636752..8f7c9a3d6f2 100644
--- a/util/sock.h
+++ b/util/sock.h
@@ -115,14 +115,6 @@ namespace mongo {
template <typename T>
const T& as() const { return *(const T*)(&sa); }
- bool isLocalHost() const {
-#if defined(_WIN32)
- return as<sockaddr_in>().sin_addr.S_un.S_addr == 0x100007f;
-#else
- return as<sockaddr_in>().sin_addr.s_addr == 0x100007f;
-#endif
- }
-
string toString(bool includePort=true) const{
stringstream out;
out << inet_ntoa(as<sockaddr_in>().sin_addr);
@@ -139,7 +131,7 @@ namespace mongo {
return as<sockaddr_in>().sin_port;
}
- bool localhost() const { return inet_addr( "127.0.0.1" ) == as<sockaddr_in>().sin_addr.s_addr; }
+ bool isLocalHost() const { return inet_addr( "127.0.0.1" ) == as<sockaddr_in>().sin_addr.s_addr; }
bool operator==(const SockAddr& r) const {
return as<sockaddr_in>().sin_addr.s_addr == r.as<sockaddr_in>().sin_addr.s_addr &&