Browse Source

2006-06-30 Gonzalo Paniagua Javier <[email protected]>

	* Socket.cs: patch from Sanghyeon Seo that implements
	(Send|Receive)Timeout for 2.0.
	* MulticastOption.cs: more 2.0 stuff.


svn path=/trunk/mcs/; revision=62157
Gonzalo Paniagua Javier 19 năm trước cách đây
mục cha
commit
c2bf44ca7e

+ 6 - 0
mcs/class/System/System.Net.Sockets/ChangeLog

@@ -1,3 +1,9 @@
+2006-06-30 Gonzalo Paniagua Javier <[email protected]>
+
+	* Socket.cs: patch from Sanghyeon Seo that implements
+	(Send|Receive)Timeout for 2.0.
+	* MulticastOption.cs: more 2.0 stuff.
+
 2006-06-28  Atsushi Enomoto  <[email protected]>
 
 	* Socket.cs : use ConfigurationManager.GetSection() under NET_2_0.

+ 20 - 5
mcs/class/System/System.Net.Sockets/MulticastOption.cs

@@ -42,13 +42,22 @@ namespace System.Net.Sockets
 		// changing socket-io.c in the runtime
 		private IPAddress group;
 		private IPAddress local;
+#if NET_2_0
+		int iface_index;
+#endif
 
 		public MulticastOption (IPAddress grp)
 			: this (grp, IPAddress.Any)
 		{
 			group = grp;
 		}
-
+#if NET_2_0
+		[MonoTODO ("Get interface IP from interface index")]
+		public MulticastOption (IPAddress group, int interfaceIndex)
+		{
+			this.group = group;
+		}
+#endif
 		public MulticastOption (IPAddress grp, IPAddress addr)
 		{
 			if (grp == null)
@@ -61,16 +70,22 @@ namespace System.Net.Sockets
 			local = addr;
 		}
 
-		public IPAddress Group
-		{
+		public IPAddress Group {
 			get { return group; }
 			set { group = value; }
 		}
 
-		public IPAddress LocalAddress
-		{
+		public IPAddress LocalAddress {
 			get { return local; }
 			set { local = value; }
 		}
+
+#if NET_2_0
+		public int InterfaceIndex {
+			get { return iface_index; }
+			set { iface_index = value; }
+		}
+#endif
 	}
 }
+

+ 12 - 6
mcs/class/System/System.Net.Sockets/Socket.cs

@@ -702,23 +702,29 @@ namespace System.Net.Sockets
 		}
 
 #if NET_2_0
-		[MonoTODO]
 		public int SendTimeout {
 			get {
-				throw new NotImplementedException ();
+				return (int)GetSocketOption(
+					SocketOptionLevel.Socket,
+					SocketOptionName.SendTimeout);
 			}
 			set {
-				throw new NotImplementedException ();
+				SetSocketOption(
+					SocketOptionLevel.Socket,
+					SocketOptionName.SendTimeout, value);
 			}
 		}
 
-		[MonoTODO]
 		public int ReceiveTimeout {
 			get {
-				throw new NotImplementedException ();
+				return (int)GetSocketOption(
+					SocketOptionLevel.Socket,
+					SocketOptionName.ReceiveTimeout);
 			}
 			set {
-				throw new NotImplementedException ();
+				SetSocketOption(
+					SocketOptionLevel.Socket,
+					SocketOptionName.ReceiveTimeout, value);
 			}
 		}
 #endif