Symptom
When using PostURL() of the Inet object (passing in, url, http headers, port number and internet result object) for certain long running transactions that take over 30 seconds, sometimes PostURL() would return a -6.
Environment
PowerBuilder
Windows 7
Reproducing the Issue
Problem sometimes happens with long running transactions that can take over 30 seconds.
Cause
By setting the Wininet logging in the Event Viewer per http://blogs.msdn.com/b/santhoshonline/archive/2010/07/08/howto-wininet-etw-logging-analytic-logging.aspx, it showed an event 'WININET_REQUEST_HEADER' posted at 11:30:03AM. The next event happened 30 seconds later with the WININET_HANDLE_CLOSED at 11:30:33AM.
PostURL will call API functions from the wininet.dll. PostURL will return -6 if the wininet's httpsendrequest() fails.
From the PowerBuilder online help on PostURL():
The PostURL function relies on wininet.dll to post a request and returns -1 when the posting time exceeds the DLL timeout value. When you install Internet Explorer 7 or later, the default timeout value for this DLL is 30 seconds. Although it is possible to change the timeout value by configuring a ReceiveTimeOut registry key under HKEY_CURRENT_USER\ SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings, this is not recommended, since it can also affect the behavior of the Internet Explorer browser.
Solution
The following resolution requires editing the registry. Using the Registry Editor incorrectly can cause serious problems.
Use the Registry Editor at your own risk. Refer to KBA 1323322 for more information.
The ReceiveTimout registry entry was added to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings in the format listed in http://ie-support.blogspot.com/2011/02/internet-explorer-error-connection.html.
It was set to 90 seconds up from the 30 second default.