client.Bind(new IPEndPoint(IPAddress.Any, 0));
}
+#if NET_1_1
+ public TcpClient (AddressFamily family)
+ {
+ if (family != AddressFamily.InterNetwork &&
+ family != AddressFamily.InterNetworkV6) {
+ throw new ArgumentException ("Family must be InterNetwork or InterNetworkV6", "family");
+ }
+
+ Init (family);
+ client.Bind (new IPEndPoint (IPAddress.Any, 0));
+ }
+#endif
+
/// <summary>
/// Constructs a new TcpClient with a specified local endpoint.
/// Use this if you want to have your connections originating
{\r
}\r
\r
+#if NET_1_1
public UdpClient(AddressFamily family)\r
{\r
if(family != AddressFamily.InterNetwork && family != AddressFamily.InterNetwork)\r
this.family = family;\r
InitSocket (null);\r
}\r
+#endif
\r
public UdpClient (int port)\r
{\r
\r
InitSocket (localEP);\r
}\r
-\r
+
+#if NET_1_1
+ public UdpClient (int port, AddressFamily family)
+ {
+ if (family != AddressFamily.InterNetwork &&
+ family != AddressFamily.InterNetworkV6) {
+ throw new ArgumentException ("Family must be InterNetwork or InterNetworkV6", "family");
+ }
+
+ if (port < IPEndPoint.MinPort ||
+ port > IPEndPoint.MaxPort) {
+ throw new ArgumentOutOfRangeException ("port");
+ }
+
+ this.family = family;
+
+ IPEndPoint localEP = new IPEndPoint (IPAddress.Any, port);
+ InitSocket (localEP);
+ }
+#endif
+
public UdpClient (string hostname, int port)\r
{\r
if (hostname == null)\r
new IPv6MulticastOption (multicastAddr));\r
#endif\r
}\r
-\r
+
+#if NET_1_1
+ public void DropMulticastGroup (IPAddress multicastAddr,
+ int ifindex)
+ {
+ CheckDisposed ();
+
+ /* LAMESPEC: exceptions haven't been specified
+ * for this overload.
+ */
+ if (multicastAddr == null) {
+ throw new ArgumentNullException ("multicastAddr");
+ }
+
+ /* Does this overload only apply to IPv6?
+ * Only the IPv6MulticastOption has an
+ * ifindex-using constructor. The MS docs
+ * don't say.
+ */
+ if (family == AddressFamily.InterNetworkV6) {
+ socket.SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DropMembership, new IPv6MulticastOption (multicastAddr, ifindex));
+ }
+ }
+#endif
+
public void JoinMulticastGroup (IPAddress multicastAddr)\r
{\r
CheckDisposed ();\r
new IPv6MulticastOption (multicastAddr));\r
#endif\r
}\r
-\r
+
+#if NET_1_1
+ public void JoinMulticastGroup (int ifindex,
+ IPAddress multicastAddr)
+ {
+ CheckDisposed ();
+
+ /* Does this overload only apply to IPv6?
+ * Only the IPv6MulticastOption has an
+ * ifindex-using constructor. The MS docs
+ * don't say.
+ */
+ if (family == AddressFamily.InterNetworkV6) {
+ socket.SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.AddMembership, new IPv6MulticastOption (multicastAddr, ifindex));
+ }
+ }
+#endif
+
public void JoinMulticastGroup (IPAddress multicastAddr, int timeToLive)\r
{\r
CheckDisposed ();\r