Update of /cvsroot/boost/boost/boost/asio/detail
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13122

Modified Files:
        reactive_socket_service.hpp 
Log Message:
To get portable behaviour for SO_REUSEADDR with UDP, the Mac OS X and BSD
platforms also need SO_REUSEPORT to be set.


Index: reactive_socket_service.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/asio/detail/reactive_socket_service.hpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- reactive_socket_service.hpp 12 May 2007 10:46:47 -0000      1.14
+++ reactive_socket_service.hpp 20 May 2007 00:28:55 -0000      1.15
@@ -351,6 +351,22 @@
       socket_ops::setsockopt(impl.socket_,
           option.level(impl.protocol_), option.name(impl.protocol_),
           option.data(impl.protocol_), option.size(impl.protocol_), ec);
+
+#if defined(__MACH__) && defined(__APPLE__) \
+|| defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+      // To implement portable behaviour for SO_REUSEADDR with UDP sockets we
+      // need to also set SO_REUSEPORT on BSD-based platforms.
+      if (!ec && impl.protocol_.type() == SOCK_DGRAM
+          && option.level(impl.protocol_) == SOL_SOCKET
+          && option.name(impl.protocol_) == SO_REUSEADDR)
+      {
+        boost::system::error_code ignored_ec;
+        socket_ops::setsockopt(impl.socket_, SOL_SOCKET, SO_REUSEPORT,
+            option.data(impl.protocol_), option.size(impl.protocol_),
+            ignored_ec);
+      }
+#endif
+
       return ec;
     }
   }


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to