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

svn path=/trunk/mcs/; revision=120601

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

index d6c61aa5083a060cf08a7831ad78034ce680ea04..7da38aeb32ddc1ce3e8e0829874a2972dfa6e1b7 100644 (file)
@@ -1,4 +1,9 @@
 
+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
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)