Skip to content

Commit dd5b5ca

Browse files
monojenkinsakoeplinger
authored andcommitted
Set NetworkStream.ReadTimeout in WebConnection.InitConnection(). (mono#6904)
Setting ReadTimeout in WebResponseStream.ctor throws System.Net.Sockets.SocketException : Invalid arguments on iOS. Set it in WebConnection.InitConnection() immediately after establishing a connection, before we read/write anything.
1 parent 2a3b081 commit dd5b5ca

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mcs/class/System/System.Net/WebConnection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ internal async Task<WebRequestStream> InitConnection (WebOperation operation, Ca
265265
goto retry;
266266
}
267267

268+
networkStream.ReadTimeout = operation.Request.ReadWriteTimeout;
269+
268270
return new WebRequestStream (this, operation, networkStream, tunnel);
269271
}
270272

mcs/class/System/System.Net/WebResponseStream.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public WebResponseStream (WebRequestStream request)
8181
: base (request.Connection, request.Operation, request.InnerStream)
8282
{
8383
RequestStream = request;
84-
request.InnerStream.ReadTimeout = ReadTimeout;
8584

8685
#if MONO_WEB_DEBUG
8786
ME = $"WRP(Cnc={Connection.ID}, Op={Operation.ID})";

0 commit comments

Comments
 (0)