This project is read-only.
1
Vote

Outgoing connection fails when Timeout is 0

description

When I don’t specify a <ReportServer Timeout="0"/> value other than 0 or don’t specify it at all, I get the following error:
[Settings]: Loading RSBuild settings from 'c:\Users\binki\AeroFS\repos_realwin\Main\Code\Database\Report Project\RSBuild.config'
RSBuild 1.1.2
(C)2005 Microsoft Corporation
Microsoft Corporation

--------------------------------
Database Installation
--------------------------------

--------------------------------
Reports Installation
--------------------------------
Validating reporting service: http://localhost:8080/ReportServer_SQLEXPRESS/
[PublishTask::Validate]: The underlying connection was closed: An unexpected error occurred on a receive.
This is unhelpful. When I add an extra throw into PublishTask.Validate, I get the following stack trace/inner exception expansion:
[Settings]: Loading RSBuild settings from 'c:\Users\binki\AeroFS\repos_realwin\Main\Code\Database\Report Project\RSBuild.config'
RSBuild 1.1.2
(C)2005 Microsoft Corporation
Microsoft Corporation

--------------------------------
Database Installation
--------------------------------

--------------------------------
Reports Installation
--------------------------------
Validating reporting service: http://localhost:8080/ReportServer_SQLEXPRESS/
[PublishTask::Validate]: The underlying connection was closed: An unexpected error occurred on a receive.

Unhandled Exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Timeout can be only be set to 'System.Threading.Timeout.Infinite' or a value > 0.
   at System.Net.Sockets.NetworkStream.set_ReadTimeout(Int32 value)
   at System.Net.PooledStream.set_ReadTimeout(Int32 value)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
   --- End of inner exception stack trace ---
   at RSBuild.Tasks.PublishTask.Validate() in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Tasks\PublishTask.cs:line 67
   at RSBuild.Dispatcher.RunTasks(Settings settings) in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Dispatcher.cs:line 49
   at RSBuild.AppEntry.Main(String[] args)
Signal 79
So, the problem is that timeout of 0 is not being treated, as the documentation says, like an infinite timeout. (which .net expects to be -1ms (a.k.a. Timeout.Infinite)). See attached patch to coalesce the timeout setting so that the infinite timeout is set properly.

file attachments

comments