[Mono-dev] Mono 1.2.3.1 SO_REUSEPORT / System.Net.Sockets.SocketOptionName.ReusePort Patch

Slava Shirokov slava at cyberwang.net
Sat May 5 13:47:27 EDT 2007


This patch adds the ability to set the SO_REUSEPORT socket option using System.Net.Sockets.SocketOptionName.ReusePort in 
mono 1.2.3.1

Patch also available here: http://slava.cyberwang.net/files/Code/Mono/mono-1.2.3.1-ReusePort.patch

Patch follows:
--- mcs/class/System/System.Net.Sockets/SocketOptionName.cs	Wed Jul  5 17:58:46 2006
+++ ../mono-1.2.3.1-new/mcs/class/System/System.Net.Sockets/SocketOptionName.cs	Fri May  4 17:47:49 2007
@@ -52,6 +52,10 @@

  		/// <summary>
  		/// </summary>
+		ReusePort = 512,
+
+		/// <summary>
+		/// </summary>
  		KeepAlive = 8,

  		/// <summary>
--- mono/metadata/socket-io.c	Thu Jan 25 01:11:15 2007
+++ ../mono-1.2.3.1-new/mono/metadata/socket-io.c	Fri May  4 17:12:36 2007
@@ -331,6 +331,11 @@
  		case SocketOptionName_ReuseAddress:
  			*system_name = SO_REUSEADDR;
  			break;
+#ifdef SO_REUSEPORT
+		case SocketOptionName_ReusePort:
+			*system_name = SO_REUSEPORT;
+			break;
+#endif
  		case SocketOptionName_KeepAlive:
  			*system_name = SO_KEEPALIVE;
  			break;
--- mono/metadata/socket-io.h	Thu Jan 25 01:11:15 2007
+++ ../mono-1.2.3.1-new/mono/metadata/socket-io.h	Fri May  4 17:12:02 2007
@@ -94,6 +94,7 @@
  	SocketOptionName_Debug=1,
  	SocketOptionName_AcceptConnection=2,
  	SocketOptionName_ReuseAddress=4,
+	SocketOptionName_ReusePort=512,
  	SocketOptionName_KeepAlive=8,
  	SocketOptionName_DontRoute=16,
  	SocketOptionName_Broadcast=32,



More information about the Mono-devel-list mailing list