* UdpClient.cs (Receive): Fix Bug 45633; We should do a blocking
call until a datagram is arrives from the remote host. This
removes the 512 "magic" buffer size when we did not have any data.
svn path=/trunk/mcs/; revision=17237
+2003-08-10 Miguel de Icaza <miguel@ximian.com>
+
+ * UdpClient.cs (Receive): Fix Bug 45633; We should do a blocking
+ call until a datagram is arrives from the remote host. This
+ removes the 512 "magic" buffer size when we did not have any data.
+
2003-07-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* NetworkStream.cs:
public byte [] Receive (ref IPEndPoint remoteEP)\r
{\r
CheckDisposed ();\r
- // Length of the array for receiving data??\r
+\r
+ // Bug 45633: the spec states that we should block until a datagram arrives:\r
+ // remove the 512 hardcoded value.\r
+\r
+ // Block until we get it.\r
+ socket.Poll (-1, SelectMode.SelectRead);\r
+ \r
byte [] recBuffer;\r
int available = socket.Available;\r
- if (available < 512)\r
- available = 512;\r
\r
recBuffer = new byte [available];\r
EndPoint endPoint = new IPEndPoint (IPAddress.Any, 0);\r