public class NetworkStreamTest
{
#if NET_2_0
+ [Test]
+ // See bug #371923
+ [ExpectedException(typeof(IOException))]
+ public void NetworkStreamConnection ()
+ {
+ IPEndPoint ipe = new IPEndPoint(Dns.GetHostEntry ("www.google.com").AddressList [0], 80);
+ Socket s = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
+ s.Close ();
+ NetworkStream ns = new NetworkStream (s);
+ }
+
[Test]
public void ReadTimeout ()
{
Assert.IsNotNull (sockex, "ReadTimeout #2");
/* Linux gives error 10035 (EWOULDBLOCK) here, whereas windows has 10060 (ETIMEDOUT)
- Assertion.AssertEquals ("ReadTimeout #3",
- 10060,
- sockex.ErrorCode);
+ Assert.AreEqual (10060, sockex.ErrorCode, "ReadTimeout #3");
*/
} catch {
Assert.Fail ("ReadTimeout #4");