mail-archives/mono-bugs/2003-March/004186.html

111 строки
4.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 39178][Nor] Changed - UdpClient.Connect fails with broadcast address
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:bugzilla-daemon%40rocky.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="004185.html">
<LINK REL="Next" HREF="004187.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 39178][Nor] Changed - UdpClient.Connect fails with broadcast address
</H1>
<B>bugzilla-daemon@rocky.ximian.com
</B>
<A HREF="mailto:bugzilla-daemon%40rocky.ximian.com"
TITLE="[Mono-bugs] [Bug 39178][Nor] Changed - UdpClient.Connect fails with broadcast address">bugzilla-daemon@rocky.ximian.com
</A><BR>
<I>Tue, 11 Mar 2003 06:46:30 -0500 (EST)</I>
<P><UL>
<LI> Previous message: <A HREF="004185.html">[Mono-bugs] [Bug 39462][Nor] New - Incorrect warning when overriding a delegate with a method.
</A></li>
<LI> Next message: <A HREF="004187.html">[Mono-bugs] [Bug 38812][Min] Changed - Array.Copy doesn't check member types.
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#4186">[ date ]</a>
<a href="thread.html#4186">[ thread ]</a>
<a href="subject.html#4186">[ subject ]</a>
<a href="author.html#4186">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by <A HREF="mailto:dick@ximian.com.">dick@ximian.com.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=39178">http://bugzilla.ximian.com/show_bug.cgi?id=39178</A>
--- shadow/39178 Thu Mar 6 11:44:06 2003
+++ shadow/39178.tmp.6634 Tue Mar 11 06:46:30 2003
@@ -67,6 +67,47 @@
Client.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.Broadcast, 1);
before calling Connect.
(Client property = the Socket (it's protected in UdpClient))
+
+------- Additional Comments From <A HREF="mailto:dick@ximian.com">dick@ximian.com</A> 2003-03-11 06:46 -------
+Just for reference, I thought I'd added this before but I must have
+forgotten to:
+
+&lt;Dick&gt; EINTR? sounds more like EACCES
+&lt;Dick&gt; System.Net.Sockets.SocketException: Access denied
+&lt;Dick&gt; +in (unmanaged) mono(mono_raise_exception+0x20) [0x80c14f4]
+&lt;Dick&gt; +in (unmanaged) mono
+&lt;Dick&gt; +(ves_icall_System_Net_Sockets_Socket_Connect_internal+0x7a)
+[0x80dbef6]
+&lt;Dick&gt; &quot;EACCES, EPERM
+&lt;Dick&gt; The user tried to connect to a broadcast address
+&lt;Dick&gt; without having the socket broadcast flag enabled or
+&lt;Dick&gt; the connection request failed because of a local
+&lt;Dick&gt; firewall rule.
+&lt;Dick&gt; &quot;
+&lt;gonzalo&gt; i saw a errno=4 with gdb
+&lt;gonzalo&gt; #define EINTR 4 /* Interrupted system
+call */
+&lt;Dick&gt; #define EACCES 13 /* Permission denied */
+&lt;Dick&gt; 321 if(ret==-1) {
+&lt;Dick&gt; (gdb) print errno
+&lt;Dick&gt; $2 = 4
+&lt;Dick&gt; (gdb) n
+&lt;Dick&gt; 322 gint errnum = errno;
+&lt;Dick&gt; (gdb)
+&lt;Dick&gt; 327 errnum = errno_to_WSA (errnum,
+G_GNUC_PRETTY_FUNCTION);
+&lt;Dick&gt; (gdb) s
+&lt;Dick&gt; errno_to_WSA (code=13, function_name=0x8190c73 &quot;_wapi_connect&quot;)
+at error.c:62
+&lt;Dick&gt; 62 gint result = -1;
+&lt;Dick&gt; looks like some optimisation has shuffled errno assigning around
+&lt;Dick&gt; there doesnt seem to be any way of setting SO_BROADCAST from
+the class libraries, so i guess we need to see if we get EACCESS and
+try setting it there
+&lt;gonzalo&gt; btw, it works under mono/windows
+&lt;Dick&gt; yeah, its the library or the kernel denying you access for
+broadcast addresses
+
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="004185.html">[Mono-bugs] [Bug 39462][Nor] New - Incorrect warning when overriding a delegate with a method.
</A></li>
<LI> Next message: <A HREF="004187.html">[Mono-bugs] [Bug 38812][Min] Changed - Array.Copy doesn't check member types.
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#4186">[ date ]</a>
<a href="thread.html#4186">[ thread ]</a>
<a href="subject.html#4186">[ subject ]</a>
<a href="author.html#4186">[ author ]</a>
</LI>
</UL>
</body></html>