2008-12-03 Gonzalo Paniagua Javier <gonzalo@novell.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 3 Dec 2008 15:33:28 +0000 (15:33 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 3 Dec 2008 15:33:28 +0000 (15:33 -0000)
* UdpClient.cs: don't Poll() in Receive(), the call to ReceiveFrom
will block anyway. Fixes bug #455894.

2008-11-12 Gonzalo Paniagua Javier <gonzalo@novell.com>

* Socket.cs: mark the socket as not connected when there is a pending
error or exception about to be thrown.
Bug #443346 fixed.

svn path=/branches/mono-2-2/mcs/; revision=120602

mcs/class/System/System.Net.Sockets/ChangeLog
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net.Sockets/UdpClient.cs

index aaf93ce73ca68f39fd3e670096fc68c1494d5b62..7da38aeb32ddc1ce3e8e0829874a2972dfa6e1b7 100644 (file)
@@ -1,3 +1,15 @@
+
+2008-12-03 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+       * UdpClient.cs: don't Poll() in Receive(), the call to ReceiveFrom
+       will block anyway. Fixes bug #455894.
+
+2008-11-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+       * Socket.cs: mark the socket as not connected when there is a pending
+       error or exception about to be thrown.
+       Bug #443346 fixed.
+
 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
 
        * Socket.cs : Adding a comment to provide locations where
index d0044da344c21c4d7cd390bb662999fb86bb501c..b273d718e086943190cbdbc41245e7d10c3703e4 100644 (file)
@@ -138,11 +138,14 @@ namespace System.Net.Sockets
                        public void CheckIfThrowDelayedException ()
                        {
                                if (delayedException != null) {
+                                       Sock.connected = false;
                                        throw delayedException;
                                }
 
-                               if (error != 0)
+                               if (error != 0) {
+                                       Sock.connected = false;
                                        throw new SocketException (error);
+                               }
                        }
 
                        void CompleteAllOnDispose (Queue queue)
index 2f72168c65aa5cf0ecbcdd5c623c45aff0e1e76b..207a467a72804942274cf43c6f08aca15be6e666 100644 (file)
@@ -309,16 +309,7 @@ namespace System.Net.Sockets
                {
                        CheckDisposed ();
 
-                       // Bug 45633: the spec states that we should block until a datagram arrives:
-                       // remove the 512 hardcoded value.
-
-                       // Block until we get it.
-                       socket.Poll (-1, SelectMode.SelectRead);
-                       
-                       byte [] recBuffer;
-                       int available = socket.Available;
-
-                       recBuffer = new byte [available];
+                       byte [] recBuffer = new byte [65536]; // Max. size
                        EndPoint endPoint = new IPEndPoint (IPAddress.Any, 0);
                        int dataRead = socket.ReceiveFrom (recBuffer, ref endPoint);
                        if (dataRead < recBuffer.Length)