summaryrefslogtreecommitdiff
path: root/util/sock.h
diff options
context:
space:
mode:
authoryellow <yellow@10gen.com>2008-01-24 16:09:24 +0000
committeryellow <yellow@10gen.com>2008-01-24 16:09:24 +0000
commit573b11ecd4c9592f4199f9c6f416a372e540765e (patch)
treef51bb3283ac044d761dbfaeff58f9171730ca446 /util/sock.h
parentda8ecf472130fa901330d34e38270d0e84779170 (diff)
downloadmongo-573b11ecd4c9592f4199f9c6f416a372e540765e.tar.gz
prebind
Diffstat (limited to 'util/sock.h')
-rw-r--r--util/sock.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/sock.h b/util/sock.h
index 267102fca3a..9bd3088fc2d 100644
--- a/util/sock.h
+++ b/util/sock.h
@@ -16,6 +16,8 @@ inline void disableNagle(int sock) {
if( setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *) &x, sizeof(x)) )
cout << "ERROR: disableNagle failed" << endl;
}
+inline void prebindOptions( int sock ){
+}
#else
#include <sys/socket.h>
#include <sys/types.h>
@@ -34,6 +36,14 @@ inline void disableNagle(int sock) {
if( setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *) &x, sizeof(x)) )
cout << "ERROR: disableNagle failed" << endl;
}
+inline void prebindOptions( int sock ){
+ cout << "doing prebind option" << endl;
+ int x = 1;
+ if ( setsockopt( sock , SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x)) < 0 )
+ cout << "Failed to set socket opt, SO_REUSEADDR" << endl;
+}
+
+
#endif
struct SockAddr {