C# Setting WriteTimeout / ReadTimeout on Network Stream Makes No Difference?
问题 I have following method code in my Xamarin.Forms application using (TcpClient client = new TcpClient(ip, port)) using (NetworkStream stream = client.GetStream()) { byte[] messageBytes = PrepareMessageBytes(); // // Setting these seam to have no effect // stream.WriteTimeout = (int)TimeSpan.FromSeconds(10).TotalMilliseconds; stream.ReadTimeout = (int)TimeSpan.FromSeconds(10).TotalMilliseconds; // // I have set read and write timeouts above but when // hitting this line, app hangs indefinitely?